in reply to Access the Keys of a Hash Reference Without a For Loop
my %hash = ('foo' => 'foo'); my $ref = \%hash; print exists $ref->{'foo'}; #Prints 1 (true) print exists $ref->{'bar'}->{'baz'}; #Prints nothing (false) print exists $ref->{'bar'}; #Prints 1 (true)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Access the Keys of a Hash Reference Without a For Loop
by Dru (Hermit) on Nov 01, 2010 at 18:44 UTC |