Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Having trouble reading in a hash from a referenced array

by bliako (Monsignor)
on Dec 18, 2020 at 23:07 UTC ( [id://11125435]=note: print w/replies, xml ) Need Help??


in reply to Having trouble reading in a hash from a referenced array

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-24 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found