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

[perl #5087] used only once warning

Thread Previous | Thread Next
From:
Peter Martini via RT
Date:
December 10, 2012 18:13
Subject:
[perl #5087] used only once warning
Message ID:
rt-3.6.HEAD-17500-1355163174-1893.5087-14-0@perl.org
So, I wrote a patch to do this, but I can't submit that patch as is
because there's quite a few tests that fail (the tests check to make
sure no warnings are triggered, and now they capture the used once warning).

Virtually all of the warnings I've seen are due to this style of code:

sub {
my ($self, @args) = @_;
do_something @args;
}

Which I suspect exists often enough in the wild that a lot of
scripts/modules would see new warnings if this is enabled ...

Although, code in evals (which includes use and require) doesn't trigger
the used once warning even if use warnings 'once' is enabled, and I see
no reason to make a warning on lexicals used only once behave any
differently.

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