Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Use of uninitialized value in substr

by amedico (Sexton)
on May 04, 2010 at 04:34 UTC ( [id://838236]=note: print w/replies, xml ) Need Help??


in reply to Re: Use of uninitialized value in substr
in thread Use of uninitialized value in substr

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://838236]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found