in reply to qr//o ... "o"??
That's what happens. The op-tree is modified because of the /o modifier. Perl never sees the "compile this regex" op again, and instead, it uses some pre-compiled regex.print "trying...\n"; $x = qr/japhy/o; print $you =~ $x; # makes a tree like [print "trying\n"] [compile regex /japhy/] [return regex (some internal form)] [match regex on $you] [print] # the /o modifier tells [return regex] to MODIFY the tree [print "trying\n"] -------------------\ [compile regex /japhy/] | [return regex (some internal form)] <-/ [match regex on $you] [print]
|
|---|