"Mr. Shawn H. Corey" schreef:

> [autovivication]
> Perl does this even if you're just testing.  I don't know why.
> [...]
> if( exists $var->{foo}{bar}[5] ){
>   print "foobar\n";
> }
> print Dumper $var;

"just testing"? 
exists() just doesn't shortcut. 
So to test $var->{foo}{bar}[5] 
you just need to have $var->{foo}{bar}, etc.

Just Google on autovivication. Just some examples:
http://en.wikipedia.org/wiki/Autovivification 
http://www.sysarch.com/Perl/autoviv.txt 

Or just step through your code with perl -d. 

-- 
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