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

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
Ricardo Signes
July 6, 2012 05:06
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
* Linda W <> [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

   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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About