On Thu, Jan 05, 2012 at 02:58:30PM -0800, Robert Colvin via RT wrote: > On Thu Jan 05 08:18:43 2012, > zefram@fysh.org wrote: > > Robert Colvin via RT wrote: > > >But in my opinion if the > default behaviour is to create > the variable > > >reference when I test for its > existence, that is a bug. > > > > It's not a bug. The behaviour > is perfectly consistent across > operators. > > "exists" does not create the > hash element that you ask it > about. > > The autovivification applies to > the *hash* in which you looked. > > > > -zefram > > > > > indeed it may be consistent, > though it is ultimately > incorrect! in testing existence > the state of variables are > modified. exists should be a safe > operation and it is therefore > reasonable to expect that it > won't make any modifications From perldoc -f exists: This surprising autovivification in what does not at first--or even second--glance appear to be an lvalue context may be fixed in a future release. -- Paul Johnson - paul@pjcj.net http://www.pjcj.netThread Previous