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

Re: [perl #113974] package NAMESPACE manpage comments

Thread Previous | Thread Next
David Golden
July 5, 2012 12:01
Re: [perl #113974] package NAMESPACE manpage comments
Message ID:
On Thu, Jul 5, 2012 at 11:36 AM, Linda W <> wrote:
> What replaces this functionality? as shown above, 'our' doesn't
> work.

Nothing replaces it.  The intent is that (under strictures)
programmers should either use "our" in *every* scope they need a short
alias to a package variable, or they should use the fully qualified

That said, I think that "obsolete" is not a valid term per perlpolicy,
and it should probably be changed in the documentation to
"discouraged", to make it clear that it's not going away, but that
people should think twice (or three times) before using it for new

FWIW, in your A/B example, I would probably write it to have package B
be a *nested* scope within package A, rather than having three
successive scopes A/B/A.  For me, repeated namespaces in serial scopes
are a code smell -- a sign that I haven't sufficiently modularized the


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