Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Location of Conditional test effects results

by ferreira (Chaplain)
on Apr 10, 2007 at 19:43 UTC ( #609240=note: print w/replies, xml ) Need Help??

in reply to Location of Conditional test effects results

That's called autovivification IIRC. See:

$ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> %a = () () pirl @> print "ok" if $a{k} undef pirl @> \%a # no surprise {} pirl @> print "ok" if $a{k}[0] undef pirl @> \%a # bang! { k => [] }

When accessing elements of a structure (hash or array ref) in a nested level, you may find out that Perl "helpfully" sprang some structures to life. If you're not ready for this, it may give a lot of headache.

Autovivification issues happen a lot here. See for example Hash Autovivification Weirdness, Re: Array mysteriously growing (autovivification explained), Autovivification of scalars in sub calls, Autovivification for dummies (using Test::More), The Bad, the Ugly, and the Good of autovivification or look for more following the super search;HIT=vivification.

Replies are listed 'Best First'.
Re^2: Location of Conditional test effects results
by chakram88 (Pilgrim) on Apr 10, 2007 at 20:24 UTC
    Well, sure, it's clear now. Thanks for the explanation, and lots of info to absorb.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://609240]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2023-01-28 07:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found