Problems? Is your data what you think it is? | |
PerlMonks |
Re: Bug? Use of uninitialized value $1 in substitution iteratorby bellaire (Hermit) |
on Mar 04, 2009 at 13:01 UTC ( [id://748127]=note: print w/replies, xml ) | Need Help?? |
$1 is undefined, and any use of undef will trigger the warning. You can use the following regex if you don't want to turn the warnings off:
The e switch lets you use code for the replacement, so you can test whether $1 is defined before using it, and if it's not defined, use the empty string instead.
In Section
Seekers of Perl Wisdom
|
|