Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Hash of array.

by madtoperl (Hermit)
on Feb 09, 2017 at 09:45 UTC ( [id://1181501]=note: print w/replies, xml ) Need Help??


in reply to Hash of array.

If you are trying to push the values from hash into an array and retrieve it back, you can try this

#!/usr/bin/perl use strict; use warnings; my @array = (); my %hashcont = ( first => 0, second => 5, last => 8 ); push( @array, \%hashcont ); my $hash_ref = $array[0]; my %hash_data = %{$hash_ref}; print "$hash_data{first} $hash_data{second} $hash_data{last}\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found