develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24139] Symbol Table entry always return defined for {SCALAR}!!!

Thread Previous
Steve Grazzini
October 6, 2003 23:54
Re: [perl #24139] Symbol Table entry always return defined for {SCALAR}!!!
Message ID:
On Tue, Oct 07, 2003 at 04:48:44AM -0000, Graciliano M. P. wrote:
> Why when you access the {SCALAR} key of a symbol entry in the 
> Symbol Table of a package it always return a scalar reference?!
> Even if the scalar, or any symbol (array, hash, glob) with this
> name is not defined!

> At least this need to be documented!

It's in perlref:

    *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.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About