> -----Original Message-----
> From: Carl Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 7:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Prining hash of hash values
>
>
> At 10:28 AM 12/19/2001 +1030, Daniel Falkenberg wrote:
> >List,
> >
> >I have a hash of a hash here with that looks similar to the
> following...
> >
> >%allusers = (
> > 'USER' => {
> > 'user1' => 'YES',
> > 'user2' => 'NO',
> > 'user3' => 'YES'
> > }
> > );
> >
> >With the following code I can only print the keys of
> %allusers where I
> >want to be able to print the values as well as the second lot of keys
> >and values.
> >
> >
> >foreach $username (keys %allusers) {print $username, "\n";}
>
> I don't have Perl up and running, and I'm a real donkey when
> it comes to
> complex stuff like this, but what would happen if you did
> keys(%USER)??
Close, but USER is not a symbol name, it's a hash key pointing to
an anonymous hash.
To get the keys of that hash, you would use:
keys %{$allusers{USER}}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]