"Mr. Shawn H. Corey" schreef:

> One would think that exists( $var->{foo}{bar}[5] ) would be a
> short-cut for ( exists( $var->{foo} ) && exists( $var->{foo}{bar} ) &&
> exists( $var->{foo}{bar}[5] ) but apparently not :(

"exists() just doesn't shortcut" :)

It is about lvalue context too, see exists documentation:
"This surprising autovivification in what does not at first--or even
second--glance appear to be an lvalue context may be fixed in a future
release." (5.8.x)

There is no pragma to shut it off.

I think it is possible to create a source filter to make exists() do
what you want.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to