Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Dynamic regex assertions, capturing groups, and parsers: joy and terrorby diotalevi (Canon) |
on Oct 03, 2005 at 23:09 UTC ( [id://497077]=note: print w/replies, xml ) | Need Help?? |
The result of (??{ print $1 }) is 1 because print() succeeded in writing to STDOUT. The regex that was then compiled by (??{ ...}) was "1" which then failed. So the (.) advanced over every character and printed them individually. The proper thing to do here would have been (?{ ... }) which will not affect regex matching.
In Section
Meditations
|
|