in reply to Re^3: Check for variable without leaving a trace
in thread Check for variable without leaving a trace

It mostly can (or at least could before 5.11), using defined:
main @> $test = 1 1 main @> defined $test 1 main @> defined %test '' main @> %test2 = 1,2 1 2 main @> defined $test2 '' main @> defined %test2 1 main @> %test3 = () undef main @> defined %test3 '' main @> defined $test3 ''
It doesn't detect an empty hash, but that's good enough for me.

Replies are listed 'Best First'.
Re^5: Check for variable without leaving a trace
by Fox (Pilgrim) on Dec 09, 2009 at 17:07 UTC
    no, I meant, perl can tell if $a or %a is defined but given 'a' it can't say which one was used.