[Omaha.pm] This is the best thing ever

Jay Hannah jay at jays.net
Fri Sep 23 09:38:33 PDT 2011


LOL! I have NO IDEA what this does.  :)

j



https://gist.github.com/1237698

use 5.14.1;

my $str = q {This is the best thing ever.};
my $re  = qr{(.i.) .+? (.e.)};

$str =~ $re;

for (1 .. $#-) {
  my $substr = substr $str, $-[ $_ ], $+[ $_ ] - $-[ $_ ];
  printf "match %s (from %2s to %2s): %s\n", $_, $-[ $_ ], $+[ $_ ], $substr;
}



More information about the Omaha-pm mailing list