Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: multidimensional array's

by LanX (Chancellor)
on Dec 27, 2012 at 20:50 UTC ( #1010576=note: print w/replies, xml ) Need Help??

in reply to multidimensional array's


I didn't really understand the context but for the following line

$results[$loopcount] [1] = (@$row[1]); THIS LINE IS NOT WORKING.

can't work, since you can't assign an @array-list to an array element¹, only scalars (simple or references)

in your case you have the option between

$results[$loopcount][1] = $row[1]

which copies references


$results[$loopcount][1] = [@$row[1]]

which creates a new array-reference with elements copied (one-level deep)

While ignoring the rest of your post I hope this helps! =)

Cheers Rolf

¹) well you won't get an error here, because Perl will take the size of the array in scalar context.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010576]
[Discipulus]: more: just one thread in the last ~5 years
[Discipulus]: but Dumas is waiting for me in the bed.. luckly as book author.. see you!
[ELISHEVA]: Sleep well!
[ELISHEVA]: Or read well
[Discipulus]: thanks, best dreams to you all

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-05-28 20:47 GMT
Find Nodes?
    Voting Booth?