in reply to Re^4: optimization - exists should return a reference
in thread optimization - exists should return a reference

print ${exists $foo{'bar'}}; # ... print ${$foo{'bar'}};
These differ. The former would print the value of $foo{bar}, the latter of ${$foo{bar}}.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^6: optimization - exists should return a reference
by LAI (Hermit) on Jan 16, 2003 at 16:11 UTC

    Sorry, my fault for not being clear. I wrote:

    print ${exists $foo{'bar'}}; #[...][is] really no different from: print ${$foo{'bar'}};

    When what I meant is that either can be considered 'wrong' for the same reason: that they may be undef or scalar or whatnot, therefore breaking the dereference.


    LAI
    :eof