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

Re: 2 dimensional array question

by ysth (Canon)
on Sep 05, 2005 at 14:26 UTC ( #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
Node Status?
node history
Node Type: note [id://489233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-05-16 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (151 votes). Check out past polls.

    Notices?