develooper Front page | perl.perl5.porters | Postings from January 2011

Re: [PATCH 2/3] modernise package variable style

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
January 31, 2011 00:27
Subject:
Re: [PATCH 2/3] modernise package variable style
Message ID:
20110131082742.GA3952@klangraum.plasmasturm.org
* Eric Brine <ikegami@adaelis.com> [2011-01-31 07:40]:
> On Sun, Jan 30, 2011 at 5:02 PM, Aristotle Pagaltzis <pagaltzis@gmx.de>wrote:
> > +our @ISA = qw(Tie::StdHash);
> >
> > -use vars qw($SIGACTION_FLAGS $_SIGRTMIN $_SIGRTMAX $_sigrtn @ISA);
> > -@POSIX::SigRt::ISA = qw(Tie::StdHash);
> > +our ($_SIGRTMIN, $_SIGRTMAX, $_sigrtn);
> >
> > -$SIGACTION_FLAGS = 0;
> > +our $SIGACTION_FLAGS = 0;
> >
>
> <<use vars>> should be used instead of <<our>> for vars that
> can be accessed from outside the module to prevent "used only
> once" warnings. Switching <<$SIGACTION_FLAGS>> to <<our>> is
> a mistake. It causes proper usage of that variable to warn.

How?

It’s not exported, and if you write a fully qualified variable
access, Perl never warns about it.

Perl doesn’t warn about used once in declarations either.

I cannot get unqualified accesses to imported variables to warn,
no matter how the exported variable is declared with `use vars`
or `our`.

So I hereby state that I don’t know what you’re talking about.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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