in reply to Re: Re: weird problem or perl-bug?
in thread weird problem or perl-bug?

print 'a' if exists $vars[xxx]{zzz};
will check whether the hash contains an element with the key zzz, but not autovivify it.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: Re: Re: weird problem or perl-bug?
by PodMaster (Abbot) on Dec 21, 2003 at 01:05 UTC
    So sorry Corion, but wrong ;)
    use Data::Dumper; my @vars; print 'a' if exists $vars[xxx]{zzz}; die Dumper \@vars; __END__ $VAR1 = [ {} ];
    First you check to see if you have a hash, then you check to see if your key exists.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.