Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> perlop says (*emphasis mine*):
> Binary "=~" binds a * scalar expression * to a * pattern match * . perlop also says
If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run time. this means there is a DWIM behaviour to fall back to match m// and the following are equivalent:
please note that you could also use a plain string (line 101), but still without /g. ِAGAIN /g transforms m// and s/// to different commands with different contextual behaviour! for instance The "/g" modifier specifies global pattern matching--that is, matching as many times as possible within the string. How it behaves depends on the context. In list context, it returns a list of the substrings matched by any capturing parentheses in the regular expression. If there are no parentheses, it returns a list of all the matched strings, as if there were parentheses around the whole pattern.
Cheers Rolf
In reply to Re^3: 'g' flag w/'qr'
by LanX
|
|