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

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
July 6, 2012 05:06
Subject:
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
20120706120638.GA22115@cancer.codesimply.com
* Linda W <perl-diddler@tlinx.org> [2012-07-06T04:30:04]
> >>No, state, my and our are not dynamically scoped. They are lexically
> >>scoped: They can only be seen in the current lexical scope.
> ----
>  'my' has dynamic scope in the it goes away at end of the physical
> boundaries (sans any references to it).
> It also dynamically is created when you enter the physical
> boundaries of it's lexical scope.  It's a new var at that point.

That isn't what "dynamic scope" means here.  Note especially the "and in any
subroutines."

   dynamic scoping
       Dynamic scoping works over a dynamic scope, making variables
       visible throughout the rest of the block in which they are first
       used and in any subroutines that are called by the rest of the
       block. Dynamically scoped variables can have their values
       temporarily changed (and implicitly restored later) by a "local"
       operator.  (Compare lexical scoping.) Used more loosely to mean how
       a subroutine that is in the middle of calling another subroutine
       “contains” that subroutine at runtime.

This quote is from perlglossary.

-- 
rjbs

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