in reply to How is this printing?
Also, a lot of programmers will apply regexes against the "default" variable$foo = "bungling"; $foo =~ /(ngl.)/; ## $1 is now "ngli" $matched = $1; ## $matched = "ngli" $foo =~ /bung(ngl.)/; ## No match! $matched2 = $1; ## $matched 2 is now "ngli"
$_="tricky"; ## usually not assigned explicitly, typically comes in d +uring a for loop /tr(.{3})y/; print $1; # $1 = "ick"
|
|---|