Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Problems? Is your data what you think it is?
 
PerlMonks  

Re^7: uninitialized value in join or string

by Roy Johnson (Monsignor)
on Oct 31, 2005 at 12:09 UTC ( [id://504359]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^6: uninitialized value in join or string
in thread uninitialized value in join or string

map acts like a foreach loop, walking through an array (or list) and aliasing $_ to each element in turn. In addition to walking the list, though, map also constructs an array. The upshot is that you can transform an array with it.

But explaining that just made me realize that you can get the same result with a foreach loop in this case:

foreach (@values) { $_ = '' unless defined; }
That should be more clear. It updates each undefined element of @values to be the empty string.

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://504359]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.