educated_foo has asked for the wisdom of the Perl Monks concerning the following question:
Any suggestions?main @> keys %test:: undef main @> %{"test::h"} ? 1 : 0 0 main @> keys %test:: 'h' main @> defined %{"test::h2"} ? 1 : 0 0 main @> keys %test:: 'h' main @> *{"test::h3"}{HASH} ? 1 : 0 0 main @> keys %test:: h h3 main @> defined *{"test::h4"}{HASH} ? 1 : 0 0 main @> keys %test:: h h3 h4
Edit: After some experimentation, this test seems to do the trick:
Not too bad.exists $test::{"h"} && *{"test::h"}{HASH}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check for variable without leaving a trace
by Fox (Pilgrim) on Dec 09, 2009 at 10:46 UTC | |
by educated_foo (Vicar) on Dec 09, 2009 at 14:47 UTC | |
by Fox (Pilgrim) on Dec 09, 2009 at 16:03 UTC | |
by educated_foo (Vicar) on Dec 09, 2009 at 16:34 UTC | |
by Fox (Pilgrim) on Dec 09, 2009 at 17:07 UTC | |
|
Re: Check for variable without leaving a trace
by Fox (Pilgrim) on Dec 10, 2009 at 10:07 UTC | |
|
Re: Check for variable without leaving a trace
by rowdog (Curate) on Dec 10, 2009 at 15:25 UTC |