[VPM] question about possible Perl runtime bug

abez abez at abez.ca
Mon Jul 7 18:20:35 CDT 2003



Yah so much code depends on it and it saves a lot of headaches for a simple hack
but in a larger system stuff like auto-vivify is a pain.

Just remember to use exists or make a small lib of handle anti-auto-vivify
methods.

abram

On Mon, 7 Jul 2003, Peter Scott wrote:

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

-- 
abez ------------------------------------------
http://www.abez.ca/ Abram Hindle (abez at abez.ca)
------------------------------------------ abez



More information about the Victoria-pm mailing list