Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: how to assign map results to arrays

by pc88mxer (Vicar)
on Jul 29, 2008 at 06:51 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found