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