in reply to Re^4: Hash of Hashes from file
in thread Hash of Hashes from file
Yes, that should work.
Then to add a new website/type, you could do this:
push( @{ $hoh{$user}{'Website'} }, 'website4'); push( @{ $hoh{$user}{'type'} }, 'type4'};
and to get all websites for a given user:
my @websites = @{ $hoh{$user}{'Website'} };
The syntax looks strange because you're storing an array ref, and have to dereference it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Hash of Hashes from file
by cipher (Acolyte) on Apr 03, 2012 at 16:01 UTC | |
by scorpio17 (Canon) on Apr 03, 2012 at 18:49 UTC | |
by cipher (Acolyte) on Apr 05, 2012 at 00:53 UTC |
In Section
Seekers of Perl Wisdom