Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

Re: how to assign map results to arrays

by pc88mxer (Vicar)
on Jul 29, 2008 at 06:51 UTC ( #700740=note: print w/ replies, xml ) Need Help??


in reply to how to assign map results to arrays

How about:

@ar1 = split(';', $num1); @ar2 = split(';', $num2);

Update: if you want to know how to get

# given: @num = ("1;2;3", "4;5;6"); $array[0] = [1, 2, 3]; $array[1] = [4, 5, 6];
then you want:
@array = map { [ split(';', $_) ] } (@num);
The square brackets around split create an array reference out of what split returns.


Comment on Re: how to assign map results to arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2014-04-18 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls