develooper Front page | perl.perl5.porters | Postings from December 2004

$Package::_ in blead and maint

Thread Next
From:
Nicholas Clark
Date:
December 3, 2004 10:43
Subject:
$Package::_ in blead and maint
Message ID:
20041203184346.GN77507@plum.flirble.org
Was this change in behaviour intended?

$ perl -le '$_= main; $Foo::_ = Foo; print "$]: $_"'
5.008006: main

$ ./perl -le '$_= main; $Foo::_ = Foo; print "$]: $_"'
5.009002: Foo


ie now in blead there is only one $_, whatever explicit package you gave it.
This differs from previous perls, where things like $_ and @INC aren't forced
into main if you give a full package.

I think that it's due to this bit of gv.c:

    /* $_ should always be in main:: even when our'ed */
    if (*name == '_' && !name[1])
	stash = PL_defstash;


Nicholas Clark

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