Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Updated Hashes & Arrays

by davidrw (Prior)
on Aug 29, 2005 at 21:19 UTC ( [id://487567]=note: print w/replies, xml ) Need Help??


in reply to Updated Hashes & Arrays

push @{$subjects{$subject}}, %info;
The elements of the array need to be hashrefs, so do this instead:
push @{$subjects{$subject}}, \%info; print "email: " . $subjects{$subject}->[0]->{email};
Please use strict; and use warnings .. the line my @ar = @{subjects{$key}}; is missing a "$" .. also note you can write that output as:
foreach my $key (sort (keys %subjects)){ print "\n\nKEY = $key"; print "\nSize of Array = " . scalar @{$subjects{$key}}; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-18 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found