Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Adding cols to 3d arrays - syntax

by 1nickt (Abbot)
on Sep 19, 2019 at 12:01 UTC ( #11106375=note: print w/replies, xml ) Need Help??


in reply to Adding cols to 3d arrays - syntax

Hi, first off, your life would be easier if you used hashes for nested data.

With

push @{ $myarr[$lpn] }, $ppn;
you are adding a scalar value to your sub-array. Then later you try to push to it as if it were itself an array.

Probably changing the above line to

$myarr{$lpn}{$ppn} = ();
would get you on the right track.

Hope this helps!


The way forward always starts with a minimal test.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2019-10-18 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?