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

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
July 5, 2012 18:15
Subject:
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
20120706011500.GC30375@tozt.net
On Thu, Jul 05, 2012 at 06:09:17PM -0700, Father Chrysostomos via RT wrote:
> On Thu Jul 05 17:23:06 2012, doy@tozt.net wrote:
> > Not quite - we still need to fix "dynamic variables",
> 
> I have often been confused as to why they are called that.  Perhaps
> because they can be swapped out dynamically with local and *foo = ...? 
> ‘Package variables’ would be a better term.

But $Foo::bar is also a package variable, and it is unaffected by a
package declaration. David Golden suggested "unqualified variables",
which also isn't quite right (because of lexicals), but "unqualified
package variables" might be good enough.

> 
> > and decide whether
> > multiple 'our' declarations in the same scope should warn, like 'my'
> > declarations do.
> 
> One of my pet peeves:  I can’t use prefix ‘our’ when I use $AUTOLOAD,
> because it might warn.  I have to put ‘our $AUTOLOAD;’ at the top, which
> is sometimes less convenient that putting it next to each use (making
> refactoring easier).
> 
> It should probably only warn if the second ‘our’ is in a different package.

This is in fact the opposite situation to what happens currently - there
is a warning for multiple declarations in the same package, but not if
they are in different packages(:

-doy

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