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

Re^2: Problems with map(function, array)

by Redei (Initiate)
on Dec 10, 2012 at 21:30 UTC ( #1008168=note: print w/ replies, xml ) Need Help??


in reply to Re: Problems with map(function, array)
in thread Problems with map(function, array)

You're right when you say I should have used freshly reinitialised input. But where does map destroy the input array?

EDIT: Okay, I've got it now. Thanks for your help.


Comment on Re^2: Problems with map(function, array)
Download Code
Re^3: Problems with map(function, array)
by LanX (Canon) on Dec 10, 2012 at 21:38 UTC
    The array is not exactly deleted, but the elements are reduced to empty strings:

    DB<139> sub my_uc { my $c = shift; return uc($c); } DB<140> my_uc() DB<141> @a = map my_uc, a..c => ("", "", "")

    keep in mind no argument means $c is undef!

    Cheers Rolf

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-11-28 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (191 votes), past polls