in reply to Symbol Table entry always return defined for {SCALAR}!!!

This appears to be documented in perlref according to Steve Grazzini on p5p:
*foo{THING} returns undef if that particular THING hasn't been used yet, except in the case of scalars. *foo{SCALAR} returns a reference to an anonymous scalar if $foo hasn't been used yet. This might change in a future release.

This implies to me it might get changed for 5.10. But I certainly wouldn't count on it. And I certainly would not expect a bug fix for 5.8.2 soon.

Liz

  • Comment on Re: Symbol Table entry always return defined for {SCALAR}!!!

Replies are listed 'Best First'.
Re: Re: Symbol Table entry always return defined for {SCALAR}!!!
by Anonymous Monk on Oct 07, 2003 at 09:37 UTC
    What happens in more detail is that *foo{SCALAR} first looks up the glob *foo, creating it if it doesn't exist. And, for hysterical raisins, just about every glob has a scalar entry automatically created. Then it looks up the SCALAR entry for the glob, and what do you know, there it is. The automatic creation of scalars for every glob has been there a *long* time...I think people are a little scared to change it.