[VPM] question about possible Perl runtime bug

Peter Scott Peter at PSDT.com
Mon Jul 7 16:50:54 CDT 2003


At 8:13 PM -0700 7/6/03, Darren Duncan wrote:
>As an addendum, Perl is supposed to make easy things easy and so 
>forth.  Having a no-auto-vivify option will certainly make it a lot 
>easier to develop in.  This is something that should be handled at 
>the language level, not the app level. -- Darren Duncan


May I suggest not opening that can of worms in p5p. The issue has 
been discussed to death before and there is nothing new here. The 
mode you suggest has been discussed and I think it is at the "patches 
welcome" stage.

The behavior is documented; it's very useful for things like 
multilevel hash population:

	$foo{bar}{baz} = 42;

I've never actually wanted to turn it off; there have been many cases 
when I was glad it was there.  Well, there might have been one case 
when I wanted to turn it off. Usually the thing that annoys people is 
that exists() will autovivify the first level hash key:

	if (exists $foo{bar}{baz})  # autovivifies bar key

I think that's the case that got in my way once. If you search the 
archives you'll find out why no one has yet figured out how to stop 
this from happening.

Peter (on iBook in tutorial at Perl Conference)



More information about the Victoria-pm mailing list