Front page | perl.perl6.language |
Postings from November 2002
Re: on Topic
From: Larry Wall
November 13, 2002 18:09
Re: on Topic
Message ID: 20021114020945.GA17308@wall.org
On Thu, Nov 14, 2002 at 04:28:17AM +0200, email@example.com wrote:
: > : will it be an error to declare it as "our $_" ;
: > No, in this case, $_ is still considered a lexical, but it just happens
: > to be aliased to a variable in the current package.
: which variable ? it seems that "our $_" is something like that (???)
: my $_ # implicit -- at the beginning of file ( or actually any other
: # lexical scope
: our $_ ; # translated to : our $Main::_ := $_ ;
No, that's backwards.
: . # or $_ := $Main::_
More like that, except a new lexical name is introduced as with "my".
: ( i have in mind that "our $thing " is something like this : "dont
: worry , $thing is variable from current package )
Well, it has that effect, but it does so by pretending it's a lexical.
: but that would be strange , because I thaought that my/our manipulate
: names in symbol-table , while aliasing is compleatly orthogonal to
: that. or "our $_" is just special case with perl making additional
: magic .
No special magic. For any variable, saying
is very much like
my $foo ::= $P::foo