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

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

Thread Previous | Thread Next
Eric Brine
January 30, 2011 22:38
Re: [PATCH 2/3] modernise package variable style
Message ID:
On Sun, Jan 30, 2011 at 5:02 PM, Aristotle Pagaltzis <>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);
> +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.

<<our>> is obviously ok for <<@ISA>>

<<our>> should be ok for <<$_SIGRTMIN>>, <<$_SIGRTMAX>> and <<$_sigrtn>>
since they're internal variables. (Could maybe even use <<my>>?)

- Eric

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