Help for this page

Select Code to Download


  1. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
    +'
    
  2. or download this
    $ perle 'my %x = qw{0 a 1 b 2 c}; say "$x{0}$x{1}$x{2}"'
    abc
    
  3. or download this
    $ perle 'my %x = qw{0 a 1 b 2 c}; say "012" =~ s/([012])/$x{$1}/gr'
    abc
    
  4. or download this
    $ perle 'my @x = qw{a b c}; say "$x[0]$x[1]$x[2]"'
    abc
    
  5. or download this
    $ perle 'my @x = qw{a b c}; say "012" =~ s/([012])/$x[$1]/gr'
    abc
    
  6. or download this
    $ perle 'my %ent = qw{& &amp; < &lt; > &gt;}; say "... < & > ..." =~ s
    +/([&><])/$ent{$1}/gr'
    ... &lt; &amp; &gt; ...