develooper Front page | perl.perl5.porters | Postings from June 2008

Re: How to dig through symbol tables

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 20, 2008 02:02
Subject:
Re: How to dig through symbol tables
Message ID:
20080620090224.GO99534@plum.flirble.org
On Thu, Jun 19, 2008 at 07:55:00PM -0700, Yitzchak Scott-Thoennes wrote:
> On Thu, June 19, 2008 6:10 pm, Ben Morrow wrote:
> > Quoth sorourke@ucsd.edu:
> >> Indeed, if any other slot is defined, *{FOO}{SCALAR} seems to be
> >> defined.  Is this intended behavior?
> >
> > Yes. If a glob exists at all it has a SCALAR slot.
> 
> But see
> http://search.cpan.org/dist/perl-5.10.0/pod/perl5100delta.pod#PERL_DONT_CREATE_GVSV
> 

But IIRC the Perl visible behaviour is preserved. (It just seemed safer that
way) - if you use "THINGY" syntax (ie *{FOO}{SCALAR}) then *FOO's scalar will
become allocated. It's only if you're writing XS code to traverse a typeglob
that you'll be able to tell the difference.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About