in reply to Accessing Multilevel Hash Values

my $sock = undef; my $name = 'Bob'; foreach my $conn (keys %connections){ if ($connections{$conn}{'username'} eq $name){ $sock = $conn; last; } } if (defined $sock){ print "$name owns $sock\n"; }else{ print "No soup for $name\n"; }
--perlplexer

Replies are listed 'Best First'.
Re: Re: Accessing Multilevel Hash Values
by Putzfrau (Beadle) on Apr 24, 2002 at 13:31 UTC
    Thanks, but is there a way to do this without using a loop?

    "when a new client is created, we have to kill all the children..." --Sams Teach yourself Perl 5