1 while s/pattern/length($`)/e; #### 1 while s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; #### s/^([^ ]+) +([^ ]+)/$2 $1/; # swap first two words /(\w+)\s*=\s*\1/; # match "foo = foo" /.{80,}/; # match line of at least 80 chars /^(\d+\.?\d*|\.\d+)$/; # match valid number if (/Time: (..):(..):(..)/) { # pull fields out of a line $hours = $1; $minutes = $2; $seconds = $3; } #### $_ = ; s/.*(some_string).*/$1/; #### s/.*(some_string).*/$1/s; s/.*(some_string).*\n/$1/; s/.*(some_string)[^\0]*/$1/; s/.*(some_string)(.|\n)*/$1/; chop; s/.*(some_string).*/$1/; /(some_string)/ && ($_ = $1); #### $pattern =~ s/(\W)/\\$1/g; #### /$unquoted\Q$quoted\E$unquoted/ #### /^fee|fie|foe$/ #### /^(fee|fie|foe)$/