Welcome to the Monastery | |
PerlMonks |
Re: Having trouble reading in a hash from a referenced arrayby bliako (Monsignor) |
on Dec 18, 2020 at 23:07 UTC ( [id://11125435]=note: print w/replies, xml ) | Need Help?? |
A Perl Data Structure can contain only numbers, scalars and references (for example refs to other Perl Data Structures or scalars etc). That's it. Use the square brackets notation to declare an array reference my $arrayref = [1,2,3]. You should use my @x = @{ $arrayref }; to dereference the reference back into a new array. You can skip dereferencing into an array by using the $arrayref->[0] notation to access individual array elements. bw, bliako
In Section
Seekers of Perl Wisdom
|
|