- or download this
1 while s/pattern/length($`)/e;
- or download this
1 while s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
- or download this
s/^([^ ]+) +([^ ]+)/$2 $1/; # swap first two words
/(\w+)\s*=\s*\1/; # match "foo = foo"
...
$minutes = $2;
$seconds = $3;
}
- or download this
$_ = <STDIN>;
s/.*(some_string).*/$1/;
- or download this
s/.*(some_string).*/$1/s;
s/.*(some_string).*\n/$1/;
...
chop; s/.*(some_string).*/$1/;
/(some_string)/ && ($_ = $1);
- or download this
$pattern =~ s/(\W)/\\$1/g;
- or download this
/$unquoted\Q$quoted\E$unquoted/
- or download this
/^fee|fie|foe$/
- or download this
/^(fee|fie|foe)$/