more useful options | |
PerlMonks |
Re: Bug? Use of uninitialized value $1 in substitution iteratorby moritz (Cardinal) |
on Mar 04, 2009 at 12:55 UTC ( [id://748120]=note: print w/replies, xml ) | Need Help?? |
No, the regex engine has it right. Since the capturing group didn't match, $1 is undef. If $1 contained the empty string, it would mean that the associated capturing group matched a zero-length string (not possible in your example, but in general it's possible).
I don't see a reason to change the regex though, if it does what you want. Just switch off the warning.
In Section
Seekers of Perl Wisdom
|
|