Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2016-02-09 21:22 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (326 votes), past polls