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

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
From:
Linda W
Date:
July 7, 2012 10:08
Subject:
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
4FF86CE6.30007@tlinx.org




>> Personally, I'd like to see 'our' create a package scoped variable
>> that exists
>> wherever the package is.
>>     
> I very much wouldn't. The current behavior of our actually makes sense
> in terms of scoping, really don't think we need to be moving backwards
> here.
>   
-----
I was easy to convince ... chromatic inspired the answer:

chromatic via RT wrote:
>
> My feedback is "please don't break working code when a perfectly good 
> mechanism already exists to do what you want".
>   
---
Perfectly good? Why not just make "use vars qw(xxx);"  (or is that C<< 
use var qw(xxx);>>?)
into:

   "vars $one, $two;"   (?C<<vars $one, $two;>>?)

as a full-fledged declaration that does was this -- i.e. associates a 
name with a package var in
any package of the same name (i.e. aliased to ${__PACKAGE__ ."::var"} 
)?  Seems like those
who wanna discourage use vars can continue to do so as archaic, while 
package vars become first
class citizens and not just wanderer's across the scope of a file...





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