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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://489233]
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
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (151 votes). Check out past polls.