Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Map a string to an array

by runrig (Abbot)
on Nov 01, 2013 at 22:47 UTC ( #1060850=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Map a string to an array
in thread Map a string to an array

Not sure what you're asking. Do you want to make a copy of a 2D array? Or if you don't really need a copy, can you just use the reference.

my @arr = ( [1,2], [3,4], ); my %hash = ( FirstKey => \@arr ); my $aref = $hash{FirstKey}; my $row0 = $aref->[0]; push @$row0, 99; use Data::Dumper; print Dumper \%hash;


Comment on Re^3: Map a string to an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-08-20 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (107 votes), past polls