[Chicago-talk] /i resets $1 on failed matches?

Steven Lembark lembark at wrkhors.com
Wed Jul 14 13:01:39 CDT 2004

> cat b.txt |
>     perl -ne '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/i;
>              print "$1\n" if $1;'

Obviously someone out there needs to see Andy's command line talk
before using 'cat' with 'perl -n'...

> Anybody have an answer?

Regex bug. Damian's attempt to shoehorn parts of the P6 regex
behavior into 5.8 resulted in quite a few bug reports (5.8.5,
comming out this week, should offer an improvement). Aside
from that there is no reason /i should affect the outcome of
the regex match variables. /g and /m can do things based on
finding repeating matches throughout the process but those
are related to iterative behavior of the match, not how the
individual matches are arrived at.

Steven Lembark                           9 Music Square South, Box 344
Workhorse Computing                                Nashville, TN 37203
lembark at wrkhors.com                                     1 888 359 3508

More information about the Chicago-talk mailing list