Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: 2 dimensional array question

by ysth (Canon)
on Sep 05, 2005 at 14:26 UTC ( [id://489233]=note: print w/replies, xml ) Need Help??


in reply to 2 dimensional array question

Arrays elements and hash values can only be scalars, not hashes or arrays. When something is called an array of arrays or a two-dimensional array, this is short for array of references to arrays. This means they are assigned like:
$arr[0] = [ 1, 2, 3 ];
To copy the referred to array, you'd do
@anotherarray = @{ $arr[1] };

Replies are listed 'Best First'.
Re^2: 2 dimensional array question
by redss (Monk) on Sep 05, 2005 at 14:51 UTC
    ah, thats what I was doing wrong... thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found