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

[perl #5087] used only once warning

Thread Previous | Thread Next
Peter Martini via RT
December 10, 2012 18:13
[perl #5087] used only once warning
Message ID:
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

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