Jeri has asked for the wisdom of the Perl Monks concerning the following question:
Hi! I'm trying to see if a nested Hash key exists. If it does, I want to delete it. Here's what I've written.
if (exists %{$rHoH_ProteinFamilies->{$proteinfamily}->{$PROTEIN}}) { delete $rHoH_ProteinFamilies->{$proteinfamily}->{$PROTEIN}; }
Here's the error.
exists argument is not a HASH or ARRAY element or a subroutine at HoH.pl line 123.Thanks in advance!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Testing if a HoH key exists
by johnny_carlos (Scribe) on Nov 11, 2011 at 16:56 UTC | |
by Jeri (Scribe) on Nov 11, 2011 at 17:09 UTC | |
Re: Testing if a HoH key exists
by chilledham (Friar) on Nov 11, 2011 at 16:56 UTC | |
Re: Testing if a HoH key exists
by hbm (Hermit) on Nov 11, 2011 at 17:19 UTC | |
by Jeri (Scribe) on Nov 11, 2011 at 17:20 UTC | |
by hbm (Hermit) on Nov 11, 2011 at 17:29 UTC | |
by Jeri (Scribe) on Nov 11, 2011 at 17:54 UTC | |
by hbm (Hermit) on Nov 11, 2011 at 18:16 UTC |