On Thu, 09 Feb 2006 11:23:48 -0700, Wayne Simmons wrote:
>>As of 15 minutes ago, suddenly the n+1'th member of the array is MATCHING
> $value.  Here's an >iteration of the debug prints from the above loop...
>>... against >< 
>>found match! >RX_43_0_0_001.gho< vs. ><
> 
> looks more like someone is passing in an array with an empty value. Look at
> how the array is filled and see if there's an extra return somewhere (if
> reading from file). Otherwise it looks like that last value is empty, and of
> course *anything* =~ // ....

Not quite.  An empty regex is equivalent to the *last* regex that worked:

% perl -le '$_ = "abc"; print /b/?"Yes":"No"; print //?"Yes":"No"; \
            $_ = "xyz"; print //?"Yes":"No"' 
Yes
Yes
No

perldoc perlop:

               If the PATTERN evaluates to the empty string, the last success-
               fully matched regular expression is used instead. In this case,
               only the "g" and "c" flags on the empty pattern is honoured -
               the other flags are taken from the original pattern. If no
               match has previously succeeded, this will (silently) act
               instead as a genuine empty pattern (which will always match).

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to