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