No such thing as a small change | |
PerlMonks |
Re^2: Use of uninitialized value in substrby amedico (Sexton) |
on May 04, 2010 at 04:34 UTC ( [id://838236]=note: print w/replies, xml ) | Need Help?? |
I concur. It seems perfectly reasonable for the warning to appear when passing undef (literal or via variable) - '' ought to be used when you want the replacement to be an empty string.
For the record, the documentation states:
An alternative to using substr() as an lvalue is to specify the replacement string as the 4th argument.Nothing in there about undef being recognized as a warning-free shortcut for an empty string.
In Section
Seekers of Perl Wisdom
|
|