<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># LOGO

                          笋筌筍､ 笋筌､筌ｿ筍� 筌筌筌
              笋筌､筌､筌､筌�｡    筌�筍ｶ笄ｿ笄帚｣ｹ筍ｾ笄帚｢≫｡ｼ笄溪｢帚�俄�俄�俄｣俄｣｣筌筌筌筌筌筌筌筌筌筌筍�
          笋俄�ｻ筌ｯ筌俄｡帚�停�ｻ筍ｷ笋ｮ筍吮�ｳ筌､筍絶｣ｾ笄溪｣筌ｴ笄銀�≫｣筍ｴ笄� 筌�筍� 笄絶�壺�俄�俄�俄�俄�俄�俄�俄�俄�俄�俄｢ｩ笄�
          笄倪｣ｧ 笄ｹ筌ｿ筍ｳ筍笄吮｢ｦ筍遺�ｳ笄遺｢ｱ筍� 笄銀｣ｼ筌ｿ筌ｿ笋ｿ笄≫�ｰ筌ｶ笄鞘｢絶｡�｢�  筌�筌問｣｢笄､笄ｶ笄ｶ笄� 筍ｽ笋�  筌
           笄遺｢冷｣ｲ笄樞�凪�帚｢ｦ筍娯｡ｿ  筍ｾ笄�  筌ｿ筌ｿ筍ｾ   筌ｿ 筌ｼ筌�笄鞘｢筍ｾ筌ｿ笄溪｣や｣�筍､笄､笄ｴ笄ｶ笄帚�帚�帚｢銀｡ｿ
       笋筍ｴ筍ｲ笄ｹ笄坂�� 笄絶｢ｶ筍や�遺｣凪�ｱ筌�｡ｼ笄�  笋ｰ筌ｿ筍溪｢ｳ 笋筌ｾ笋�｡懌�銀�≫｣ｰ筌ｯ笄ｾ笄ｷ笄壺�� 笋筌ｴ笄�    笋ｸ筍�
       笄倪�吮�ｳ笄､筌� 笄ｳ筌� 笄俄�凪｢ｴ筌ｱ筌ｿ筍�｣筌､笄ｾ筌溪｣ｯ筌､筌ｶ筍ｶ笋ｿ筌ｿ筌ｯ笄� 笋遺｣ｽ笄�｣筌筌�筌ｴ筌ｾ筌ｯ笄�     筌ｴ笄�
          笋筌ｹ筌ｶ筍笋遺｣ｷ筌ｶ筌､筌ｼ筌ｿ筍ｿ笋冷｡銀｣ｩ筌ｶ筍溪｣帚｣ｿ筌ｿ筌ｷ筌ｾ筌帚｣俄｣筍､笄ｾ笄帚�停�銀�俄�帚｣ｿ筍ｿ笄�     笋�筍�
         笄吮�帚｣ｲ筍ｶ筌､筌､筌ｿ筍ｿ笄銀�≫�ｻ笄ｿ笄帚�帚�吮�帚�帚�銀�俄�ｹ笄ｿ笄ｿ笋ｿ筌ｿ筌鞘｣�筍問｣笋筌�笄､笋筌遺｣ｳ筌�     笋ｨ筌ｶ筌ｦ筍､筌�｣
          笄俄｢≫｣ｴ筌銀｣ｸ笄�       筌ｰ筌ｶ笄ｴ笄�      笄遺�帚�ｻ笋ｿ筌ｿ筌ｿ筍帚�銀�俄�吮｣ｿ   筌�筍ｶ筌ｫ筌ｭ笄ｶ筌ｭ筍
         笋筌ｴ笄溪�俄｢｡筍鞘｡ｼ   笋�筍�  笄�            笋ｸ筌ｿ筍ｿ笋ｿ筍停�停�ｲ笄ｿ笄ｶ笄ｶ笄ｶ笄溪�銀�≫｣筌筌笄俄�ｳ筌�
        笄ｲ筌ｿ笄ｷ笄�｢筌ｾ笄ｷ笄ｿ笄ｦ笋､筌､筍�   笋筌筌､筌ｶ筌ｯ筌･筌､筌､筍樞��   笄遺｣ｼ筌ｿ筌ｷ筌昶｡ｳ笄､筌､筌筌   笄�  笄吮�ｻ笋ｦ筌遺｢ｳ筍�
       笋筍ｼ笋銀｣､笄ｴ笄銀��   筌ｴ笄ｿ笄ｿ笋ｶ筌ｶ筌ｿ筌ｿ笄溪�帚｢ｻ筌ｿ筌ｿ笄溪��      笄遺�ｻ筌ｿ筍坂�帚�ｷ筌ｦ筌�｡笄ｳ笋､筍      笄吮�ｧ筌�
      筌�筌ｿ笄溪��    筌筌筍 筌､筌､筌ｼ筌ｿ筌ｿ筌ｷ筌や｣ｴ筌ｿ筍ｿ笄�      笄ｰ筍� 笋ｻ筌ｿ筌ｿ筌ｶ筌�｡遺�ｻ筌� 笄遺�吮�ｲ筌､筌筍  笄鯛｢ｦ筌娯｡吮��
     笋ｰ筍溪��     笄帚｢ｩ笄ｶ笄問�帚｣筍鞘�俄�吮�ｿ筌ｿ筌ｿ筍溪��         筌ｷ  筌ｿ筌ｿ筌ｧ筍吮｢ｷ筌�｡遺��     笄俄�俄�吮｢ｷ筍��遺�帚｢ｦ
    筌�筍ｿ笄帚｢ｶ筌ｦ筌､筌､筌ｴ筌ｶ 笄遺｡ｿ笄溪�帚�俄�≫｢筌筌 笄俄�吮�帚�停��       筍ｿ 筌ｽ筌ｿ笄倪｢ｻ筌ｷ筍笄遺�俄��         笄ｹ筌�  笄�
    筍�  笋ｸ筌ｿ筍ｿ笄俄�吮�� 笄�      笄遺�俄｣俄�� 笄凪�ｲ笋､筌�｡    筌ｼ笄� 笋ｿ筌ｿ  筌ｿ笄�｢�筍       笄�筌�｣� 笋ｹ筍�
    筌ｷ筍  筍ｿ       筌笄�   筌�筌樞｣≫｣筌�筌､筌､筌ｷ筌娯�吮｢ｦ筍笋筍ｾ笄�  笋ｸ筌ｿ筍�｣ｻ笄�  笋ｹ筌�       笋ｹ筍娯｢ｳ筌懌｡�
    笋ｻ筌ｧ筌�筌ｸ筍�          筌�筍ｾ笄溪�帚�俄｣･筍ｾ笋ｿ筌ｿ筌ｿ筌ｿ筌� 笄吮��    筌ｿ笋鞘｣ｿ筍ｿ筍   笄ｻ筌ｷ笋､筍    笋ｸ筍� 笋ｿ筍�
     笄俄｢ｻ笋ｿ筌ｿ筌ｶ筌､筌､筌筌筌筌筌､筌ｴ筍ｿ笄銀�≫｣�筍ｴ笄溪｢≫｣ｴ筌ｿ筌ｿ筌ｿ筌ｿ筌ｿ筍�     筌ｼ筍溪｣ｼ筌ｿ筌ｷ笋ｻ筍懌｣�  笄倪｢ｷ筍�  筌�筌､筍ｿ 笄遺�帚��
      笄倪�ｦ笋ｿ筌坂�俄�俄�俄�吮｢ｿ笄ｩ笋ｻ筌ｿ筌ｾ笄樞�帚��  筌ｾ笄鞘�遺｢ｻ筌ｿ筌ｿ筌ｿ筌ｿ筍筍   笋ｻ筌ｰ笄溪�≫�倪｢ｦ筍ｻ筌ｿ筍�  笋ｸ筌ｷ  筌ｿ筍溪��
         笄吮�銀�帚�ｳ筌ｶ筌ｶ笄ｷ笋ｾ筌ｿ筌ｿ    笋筌ｿ   笋ｻ筌ｿ筌ｿ筌ｿ筍ｧ   笋筌ｴ笄�    笄≫�遺｢ｳ  筌ｸ笄吮｣ｦ笋ｰ筍�
             笄倪｣ｿ筌�｢ｼ筌ｿ筌ｿ筌��停｢｢筌ｿ筌ｼ筌ｧ筍 笋､筍筌ｿ筌ｿ筌ｿ筍ｧ  笋筌ｾ笄�  笋笋�筍�  筍樞｢筍ｴ筌�｣ｸ筍溪�ｳ筌�
              笄ｹ筍ｽ筌ｾ筌ｿ笄ｹ筌ｿ筌�｣ｾ笋ｯ筌ｿ筌ｿ 筍� 笄ｻ筌ｿ筌ｿ筌ｿ笄� 笋�筌ｿ笋�  筍 筍�  笋筌ｴ筌ｿ笄�｢≫｡ｼ笄� 笄�
                笄遺�� 笋ｻ筌ｿ筌ｧ笋ｸ笋溪�ｶ笋ｾ筍�  筌ｸ筍ｿ笄� 笋�筌ｾ筍溪｢ｼ  筌ｷ 筍� 筌ｰ笄銀�吮��
                   笄遺｣ｿ筌ｻ筌ｾ筌ｦ筌�｢ｸ筌�｣筌ｶ筍ｿ笄≫｣筌筌ｾ笋ｿ筍�｢ｸ  筌溪｡ｦ筌ｧ筌ｶ笄� unleashed
                    笄ｸ笋ｿ筍坂�帚�ｻ笄ｿ笄ｿ笄ｿ笄銀｣�筍ｾ笋銀｣ｾ筌鞘｣ｸ筌ｷ筍ｸ筌�｢ｰ笄溪�帚�ｻ筍�  v1.28
                      笋ｻ筍�   笄絶�壺�銀｣�筍ｾ筌ｧ筌ｿ笄≫�吮｢ｳ筌ｽ筍�
                      笄遺�ｳ笋ｦ筌､筌､筌筌､筍ｶ笄� 笄遺｢ｿ筍�  笋ｿ筍�
                            笄�    笄遺��  笄�

# NAME

e - beast mode unleashed

# SYNOPSIS

Add a trace marker:

    $ perl -Me -e 'sub f1 { trace } sub f2 { f1 } f2'

Watch a reference for changes:

    $ perl -Me -e 'my $v = {}; sub f1 { watch( $v ) } sub f2 { f1; $v-&gt;{a} = 1 } f2'

    $ perl -Me -e '
        package A {
            use e;
            my %h = ( aaa =&gt; 111 );

            watch(\%h);

            sub f1 {
                $h{b} = 1;
            }

            sub f2 {
                f1();
                delete $h{aaa};
            }
        }

        A::f2();
    '

Benchmark two snippets of code:

    $ perl -Me -e 'n { slow =&gt; sub{ ... }, fast =&gt; sub{ ... }}, 10000'

Launch the Runtime::Debugger:

    $ perl -Me -e 'repl'

Invoke the Tiny::Prof:

    $ perl -Me -e 'prof'

Convert a data structure to json:

    $ perl -Me -e 'say j { a =&gt; [ 1..3] }'

Convert a data structure to yaml:

    $ perl -Me -e 'say yml { a =&gt; [ 1..3] }'

Pretty print a data structure:

    $ perl -Me -e 'p { a =&gt; [ 1..3] }'

Data dump a data structure:

    $ perl -Me -e 'd { a =&gt; [ 1..3] }'

Devel::Peek dump a data structure:

    $ perl -Me -e 'dd { a =&gt; [ 1..3] }'

Print data as a table:

    $ perl -Me -e 'table( [qw(key value)], [qw(red 111)], [qw(blue 222)] )'
    +------+-------+
    | key  | value |
    +------+-------+
    | red  | 111   |
    | blue | 222   |
    +------+-------+

Encode/decode UTF-8:

    $ perl -Me -e 'printf "%#X\n", ord for split //, enc "\x{5D0}"'
    0XD7
    0X90

    $ perl -C -Me -e 'say dec "\xD7\x90"'
    $ perl -Me -e 'utf8; say dec "\xD7\x90"'
    ﾗ�

# DESCRIPTION

This module imports many features that make
one-liners and script debugging much faster.

It has been optimized for performance to not
import all features right away:
thereby making its startup cost quite low.

# SUBROUTINES

## Investigation

### repl

Add a breakpoint to code.

Basically inserts a Read Evaluate Print Loop.

Enable to analyze code in the process.

    CODE ...

    # Breakpoint
    repl

    CODE ...

Simple debugger on the command line:

    $ perl -Me -e 'repl'

### trace

Show a stack trace.

    trace( OPTIONS )

OPTIONS:

    -levels  =&gt; NUM,           # How many scope levels to show.
    NUM,                       # Same.

    -raw =&gt; 1,                 # Include internal calls.
    -NUM,                      # Same.

    -message =&gt; STR,           # Message to display.
    STR,                       # Same.

### watch

Watch a reference for changes.

    watch( $ref, OPTIONS )

OPTIONS:

    -clone =&gt; 0,               # Will not watch cloned objects.

    -methods =&gt; "fetch",       # Monitor just this method.
    -methods =&gt; [ "fetch" ],   # Same.

    -levels  =&gt; NUM,           # How many scope levels to show.
    NUM,                       # Same.

    -raw =&gt; 1,                 # Include internal calls.
    -NUM,                      # Same.

    -message =&gt; STR,           # Message to display.
    STR,                       # Same.

### prof

Profile the code from this point on.

    my $obj = prof;
    ...
    # $obj goes out of scope and builds results.

### n

Benchmark and compare different pieces of code.

    Time single block of code.
    n sub{ ... };
    n sub{ ... }, 100000;

    # Compare blocks of code.
    n {
        slow =&gt; sub{ ... },
        fast =&gt; sub{ ... },
    };
    n {
        slow =&gt; sub{ ... },
        fast =&gt; sub{ ... },
    }, 10000;

    $ perl -Me -e '$v = 333; n { concat =&gt; sub { 111 . $v }, interp =&gt; sub { "111$v" }, list =&gt; sub { 111,$v } }, 100000000'

              Rate interp concat   list
    interp  55248619/s     --    -6%   -62%
    concat  58479532/s     6%     --   -60%
    list   144927536/s   162%   148%     --

## Format Conversions

### j

JSON Parser.

    my $bytes = j([1, 2, 3]);
    my $bytes = j({foo =&gt; 'bar'});
    my $value = j($bytes);

Encode Perl data structure or decode JSON with ["j" in Mojo::JSON](https://metacpan.org/pod/Mojo%3A%3AJSON#j).

Convert Perl object to JSON string:

    $ perl -Me -e 'say j { a =&gt; [1..3]}'

Convert JSON string to Perl object:

    $ perl -Me -e 'p j q({"a":[1,2,3]})'

### x

XML parser.

    my $dom = x('&lt;div&gt;Hello!&lt;/div&gt;');

Turn HTML/XML input into [Mojo::DOM](https://metacpan.org/pod/Mojo%3A%3ADOM) object.

    $ perl -Me -e 'say x("&lt;div&gt;hey&lt;/dev&gt;")-&gt;at("div")-&gt;text'

Force HTML semantics:

    $ perl -Me -e 'say x-&gt;xml(0)-&gt;parse("&lt;Tag&gt;Name&lt;/Tag&gt;")'
    &lt;tag&gt;Name&lt;/tag&gt;

Force XML semantics (case sensitive tags and more):

    $ perl -Me -e 'say x-&gt;xml(1)-&gt;parse("&lt;Tag&gt;Name&lt;/Tag&gt;")'
    &lt;Tag&gt;Name&lt;/Tag&gt;

### yml

YAML parser.

Convert Perl object to YAML string:

    $ perl -Me -e 'say yml { a =&gt; [1..3]}'

Convert YAML string to Perl object:

    $ perl -Me -e 'p yml "---\na:\n- 1\n- 2\n- 3"'

### clone

Storable's deep clone.

    $ perl -Me -e '
        my $arr1   = [ 1..3 ];
        my $arr2   = clone $arr1;
        $arr2-&gt;[0] = 111;

        say $arr1;
        p $arr1;

        say "";
        say $arr2;
        p $arr2;
    '

    # Output:
    ARRAY(0x5d0b8a408518)
    [
        [0] 1,
        [1] 2,
        [2] 3,
    ]

    ARRAY(0x5d0b8a42d9e0)
    [
        [0] 111,
        [1] 2,
        [2] 3,
    ]

### enc

Encode UTF-8 code point to a byte stream:

    $ perl -Me -e 'printf "%#X\n", ord for split //, enc "\x{5D0}"'
    0XD7
    0X90

### dec

Decode a byte steam to UTF-8 code point:

    $ perl -C -Me -e 'say dec "\xD7\x90"'
    ﾗ�

### utf8

Set STDOUT and STDERR as UTF-8 encoded.

If given a filehandle, will set the encoding
for it to UTF-8.

    utf8($fh);

## Enhanced Types

### b

Work with strings.

    my $stream = b('lalala');

Turn string into a [Mojo::ByteStream](https://metacpan.org/pod/Mojo%3A%3AByteStream) object.

    $ perl -Me -e 'b(g("mojolicious.org")-&gt;body)-&gt;html_unescape-&gt;say'

### c

Work with arrays.

    my $collection = c(1, 2, 3);

Turn list into a [Mojo::Collection](https://metacpan.org/pod/Mojo%3A%3ACollection) object.

### set

Work with sets.

    my $set = set(2,4,6,4);

Turn list into a [Set::Scalar](https://metacpan.org/pod/Set%3A%3AScalar) object.

    $ perl -Me -e 'say set(2,4,6,2)'
    (2 4 6)

Get elements:

    $ perl -Me -e 'say for sort(set(2,4,6,2)-&gt;elements)'
    $ perl -Me -e 'say for sort(set(2,4,6,2)-&gt;@*)'
    2
    4
    6

Check for existence of an element:

    $ perl -Me -e 'say set(2,4,6,2)-&gt;has(7)'
    $ perl -Me -e 'say set(2,4,6,2)-&gt;has(4)'
    1

Intersection:

    $ perl -Me -e 'say set(2,4,6,2) * set(3,4,5,6)'
    (4 6)

Create a new universe:

    # Universe 1:
    # ...
    Set::Scalar::Universe-&gt;new-&gt;enter;
    # Universe 2:
    # ...

Operations:

    set                         value

    $a                          (a b c d e _ _ _ _)
    $b                          (_ _ c d e f g _ _)
    $c                          (_ _ _ _ e f g h i)

    union:        $a + $b       (a b c d e f g _ _)
    union:        $a + $b + $c  (a b c d e f g h i)
    intersection: $a * $b       (_ _ c d e _ _ _ _)
    intersection: $a * $b * $c  (_ _ _ _ e _ _ _ _)
    difference:   $a - $b       (a b _ _ _ _ _ _ _)
    difference:   $a - $b - $c  (a b _ _ _ _ _ _ _)
    unique:       $a % $b       (a b _ _ _ f g _ _)
    symm_diff:    $a / $b       (a b _ _ _ f g _ _)
    complement:   -$a           (_ _ c d e f g h i)

## Files Convenience

### f

Work with files.

    my $path = f('/home/sri/foo.txt');

Turn string into a [Mojo::File](https://metacpan.org/pod/Mojo%3A%3AFile) object.

    $ perl -Me -e 'say r j f("hello.json")-&gt;slurp'

## Math Help

### max

Get the biggest number in a list.

    $ perl -Me -e 'say max 2,4,1,3'
    4

### min

Get the smallest number in a list.

    $ perl -Me -e 'say max 2,4,1,3'
    1

## Output

### say

Obnoxious print with a newline.

    $ perl -Me -e 'say 123'
    $ perl -Me -e 'say for 1..3'

Always sends output to the terminal even
when STDOUT and/or STDERR are redirected:

    $ perl -Me -e '
        say "Shown before";
        close *STDOUT;
        close *STDERR;
        say "Shown with no stdout/err";
        print "Print not seen\n";
    '
    111
    222

### p

Pretty data printer.

    $ perl -Me -e 'p [1..3]'

### np

Return pretty printer data.

    $ perl -Me -e 'my $v = np [1..3]; say "got: $v"'

Can be used with `say` to output to the terminal
(incase STDOUT/STDERR are redirected):

    $ perl -Me -e '
        close *STDOUT;
        close *STDERR;
        say np [ 1.. 3 ];
    '

### d

Data dumper.

    $ perl -Me -e 'd [1..3]'

### dd

Internal data dumper.

    $ perl -Me -e 'dd [1..3]'

### dye

Color a string.

    $ perl -Me -e 'say dye 123, "RED"'

### table

Print data as a table:

    $ perl -Me -e 'table( [qw(key value)], [qw(red 111)], [qw(blue 222)] )'
    +------+-------+
    | key  | value |
    +------+-------+
    | red  | 111   |
    | blue | 222   |
    +------+-------+

Context sensitive!

    - Void   - output table.
    - List   - return individual lines.
    - Scalar - return entire table as a string.

## Web Related

### g

    my $res = g('example.com');
    my $res = g('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; 'Hi!');
    my $res = g('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; form =&gt; {a =&gt; 'b'});
    my $res = g('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; json =&gt; {a =&gt; 'b'});

Perform `GET` request with ["get" in Mojo::UserAgent](https://metacpan.org/pod/Mojo%3A%3AUserAgent#get) and return resulting [Mojo::Message::Response](https://metacpan.org/pod/Mojo%3A%3AMessage%3A%3AResponse) object.

    $ perl -Me -e 'say g("mojolicious.org")-&gt;dom("h1")-&gt;map("text")-&gt;join("\n")'

### post

    my $res = post('example.com');
    my $res = post('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; 'Hi!');
    my $res = post('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; form =&gt; {a =&gt; 'b'});
    my $res = post('http://example.com' =&gt; {Accept =&gt; '*/*'} =&gt; json =&gt; {a =&gt; 'b'});

Perform `POST` request with ["get" in Mojo::UserAgent](https://metacpan.org/pod/Mojo%3A%3AUserAgent#get) and return resulting [Mojo::Message::Response](https://metacpan.org/pod/Mojo%3A%3AMessage%3A%3AResponse) object.

    $ perl -Me -e 'say post("mojolicious.org")-&gt;dom("h1")-&gt;map("text")-&gt;join("\n")'

### l

Work with URLs.

    my $url = l('https://mojolicious.org');

Turn a string into a [Mojo::URL](https://metacpan.org/pod/Mojo%3A%3AURL) object.

    $ perl -Me -e 'say l("/perldoc")-&gt;to_abs(l("https://mojolicious.org"))'

## Asynchronous

This sector includes commands to run asynchronous
(or pseudo-async) operations.

It is not entirely clear which method to always use.

`runf` limits to number of action or 20 (whichever is smaller).

`runt` and `runio` have no such limits.

Typically using threads (with `runt`) seems to be fastest.

Some statistics using different run commands:

    $ gitb status -d
           s/iter   runt  runio   runf series
    runt     1.74     --   -35%   -59%   -74%
    runio    1.12    55%     --   -36%   -59%
    runf    0.716   142%    56%     --   -36%
    series  0.456   281%   146%    57%     --

    $ gitb branch -d
              Rate   runt   runf series  runio
    runt   0.592/s     --   -71%   -81%   -83%
    runf    2.02/s   240%     --   -34%   -42%
    series  3.05/s   415%    51%     --   -12%
    runio   3.47/s   486%    72%    14%     --

    $ gitb pull -d
           s/iter  runio series   runt   runf
    runio    4.27     --    -7%   -21%   -33%
    series   3.97     8%     --   -15%   -28%
    runt     3.38    26%    17%     --   -15%
    runf     2.87    49%    38%    18%     --

### runf

Run tasks in parallel using [Parallel::ForkManager](https://metacpan.org/pod/Parallel%3A%3AForkManager).

Returns the results.

    $ perl -Me -e '
        p {
            runf
            map {
                my $n = $_;
                sub{ $n =&gt; $n**2 };
            } 1..5
        }
    '
    {
        1 =&gt; 1,
        2 =&gt; 4,
        3 =&gt; 9,
        4 =&gt; 16,
        5 =&gt; 25,
    }

Takes much overhead to start up!

Will use up to 20 processes.

### runio

Run tasks in parallel using [Mojo::IOLoop](https://metacpan.org/pod/Mojo%3A%3AIOLoop).

Returns the results.

    $ perl -Me -e '
        p {
            runio
            map {
                my $n = $_;
                sub{ $n =&gt; $n**2 };
            } 1..5
        }
    '
    {
        1 =&gt; 1,
        2 =&gt; 4,
        3 =&gt; 9,
        4 =&gt; 16,
        5 =&gt; 25,
    }

This is apparently better to use for IO related tasks.

### runt

Run tasks in parallel using [threads](https://metacpan.org/pod/threads).

Returns the results.

    $ perl -Me -e '
        p {
            runt
            map {
                my $n = $_;
                sub{ $n =&gt; $n**2 };
            } 1..5
        }
    '
    {
        1 =&gt; 1,
        2 =&gt; 4,
        3 =&gt; 9,
        4 =&gt; 16,
        5 =&gt; 25,
    }

This is the fastest run\* command usually.

## Package Tools

### monkey\_patch

Insert subroutines into the symbol table.

Extracted from Mojo::Util for performance.

Import methods into another package
(as done in this module):

    $ perl -e '
        package A;
        use e;
        sub import {
            my $c = caller();
            monkey_patch
                $c,
                new =&gt; sub { say "Im new" };
        }
        package main;
        A-&gt;import;
        new();
    '
    Im new

Import methods into the same package
(probably not so useful):

    $ perl -e '
        package A;
        use e;
        sub import {
            my $c = caller();
            monkey_patch
                $c,
                new =&gt; sub { say "Im new" };
        }
        A-&gt;import;
        A-&gt;new();
    '
    Im new

Perhaps can be updated based on the outcome
of this issue:
[https://github.com/mojolicious/mojo/pull/2173](https://github.com/mojolicious/mojo/pull/2173)

### pod

Work with perl pod.

### import

\[Internal\] Imports the DSL into another package.

Can be used in a sub class to import this class
plus its own commands like this:

    package e2;
    use parent qw( e );

    sub import {
        my ( $class ) = @_;
        my $class = caller;
        $class-&gt;SUPER::import( $caller );
        $class-&gt;can("monkey_patch")-&gt;(
            $caller,
            my_command_1 =&gt; sub {},
            my_command_2 =&gt; sub {},
            my_command_3 =&gt; sub {},
        );
    }

# AUTHOR

Tim Potapov, `&lt;tim.potapov[AT]gmail.com&gt;`

# BUGS

Please report any bugs or feature requests to
[https://github.com/poti1/e/issues](https://github.com/poti1/e/issues).

# SUPPORT

You can find documentation for this module
with the perldoc command.

    perldoc e

You can also look for information at:

[https://metacpan.org/pod/e](https://metacpan.org/pod/e)

[https://github.com/poti1/e](https://github.com/poti1/e)

Logo was generated using: [https://emojicombos.com/dot-art-editor](https://emojicombos.com/dot-art-editor)

# LICENSE AND COPYRIGHT

This software is Copyright (c) 2024 by Tim Potapov.

This is free software, licensed under:

    The Artistic License 2.0 (GPL Compatible)
</pre></body></html>