On Fri, 2008-10-03 at 20:11 +0200, Dr.Ruud wrote:
> "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.

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


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Linux is obsolete.
-- Andrew Tanenbaum


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


Reply via email to