develooper Front page | perl.perl5.porters | Postings from July 2012

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
From:
Eric Brine
Date:
July 6, 2012 00:12
Subject:
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
CALJW-qHW7c=9tVsLjUprmORMSzqOiSi8eW2BBxHhY5iry72W5A@mail.gmail.com
On Fri, Jul 6, 2012 at 3:04 AM, Eric Brine <ikegami@adaelis.com> wrote:

> On Fri, Jul 6, 2012 at 1:48 AM, Linda W <perl-diddler@tlinx.org> wrote:
>
>> **
>>
>>   With state both are physically scoped as well, though my is also
>> dynamically scoped.
>>
>
> No, state, my and our are not dynamically scoped. They are lexically
> scoped: They can only be seen in the current lexical scope.
>

>perl -Mstrict -E"{ my $x; } $x"
Global symbol "$x" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

>perl -Mstrict -E"{ state $x; } $x"
Global symbol "$x" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

>perl -Mstrict -E"{ our $x; } $x"
Variable "$x" is not imported at -e line 1.
Global symbol "$x" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

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