Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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: (7)
As of 2015-07-04 17:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls