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 drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-11-28 11:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls