Front page | perl.perl6.language |
Postings from November 2002
Re: on Topic
November 13, 2002 04:04
Re: on Topic
Message ID: firstname.lastname@example.org
> Sorta. To quote an excellent summary:
> "Topic is $_".
> > is $_ always lexical variable.
> > Or I can have $MyPackage::_ ?
> You can copy or alias any value.
so if I understand correctly ,
Every topicalizer defines a topicalizer scope in which there is
my $_ ;
and then lexical $_ ( implicitely ) is bound to ( or assigned to )
whatever it should in this particular topicalizer. And from that on $_
is just another lexical variable .
with no "use strict vars" any "just another variable" is taken by perl as
being global -- it is implicitly "our $just_another_var;" (???)
about any lexical veriable ( just_another_variable ) Perl have to be
explicitly informed as being such . is $_ just_another_variable in
that respect too ???
in other words , what happens if I just use $_ ( that is , without
previous declaration ) *outside any topicalizer* ?
* will it be implicitly "our $_" ( probably not , because it is
always lexical )
or * will it be implicitely "my $_" -- class/package lexical
or * will it be error to just use it without declaration
* with "use strict vars"
* with "no strict vars "
will it be an error to declare it as "our $_" ;
and to repeat the question from previous post ,
what will perl do when it see
$My_Package::_ = 1 ;
thanks , arcadi .