Larry Wall writes:
 > Correct, $_ is always lexical.  But...
 > 
 > : or  * will it be implicitely "my $_" -- class/package lexical 
 > 
 > There's no such thing as a "class/package lexical".  I think you
 > mean file-scoped lexical here.

ooo, now I understand : *scope* is orthogonal concept to class/module
symbol-tables . scope is related only to ( current ) lexical
symbol-table. and the outmost scope is file scope . all other ( inner
) lexical scopes are enclosed by  closure braces wheither it is a
definition of class , subroutine or loop . 

 > 
 > : 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::_ := $_ ; 
..        # or $_ := $Main::_ 
..
..
???

( i have in mind that "our $thing " is something like this : "dont
worry , $thing is variable from current package ) 

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 . 

 > aliased.  But the name $_ will always be interpreted according to the
 > lexical definitions set up by "my" and "our" (including the implicit
 > outer "my").
 > 


arcadi 

Reply via email to