Help for this page

Select Code to Download


  1. or download this
    ~$ perl -e '$_="qwerty"; s/r/print pos(). "\n";/e; print $_;'
    3
    qwe1ty
    
  2. or download this
    perl -e "\$_='qwerty'; s/r/print pos(). \"\n\";print \$&.\"\n\";/e; pr
    +int \$_ . \"\n\";"
    3
    r
    qwe1ty
    ~$
    
  3. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    my $var='four'; 
    $var =~ s/[fu]/say pos($var); say $&;/eg; 
    print $var . "\n\n";
    
  4. or download this
    ~/pl_test$ perl braveghost.pl
    0
    q
    ...
    1o1r
    
    ~/pl_test$