Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 65629
Status: rejected
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.23
Fixed in: (no value)



Subject: Failure to properly lexicalize $a and $b in pairwise, reduce
Using $a and $b in pairwise() or reduce() generates "Name "main::a" used only once possible typo" warnings. This article describes the issue in more detail: http://stackoverflow.com/questions/1490505/how-do-i-prevent-listmoreutils-from-warning-about-using-a-and-b-only-once
This is not something that can be fixed in the List::Util module perl itself gets around this with sort because it does exceptions in the lexer. this is not something that ordinary modules have access to. The user of reduce should use our($a,$b) to silence these warnings
Subject: Re: [rt.cpan.org #65629] Failure to properly lexicalize $a and $b in pairwise, reduce
Date: Thu, 10 Feb 2011 14:16:19 -0800
To: Graham_Barr via RT <bug-Scalar-List-Utils [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
Hmm ok. I suppose this is why other modules that simulate sort() or other methods use $_[0] and $_[1] in their subs rather than $a, $b. :) On Thu, Feb 10, 2011 at 04:54:33PM -0500, Graham_Barr via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65629 > > > This is not something that can be fixed in the List::Util module > > > perl itself gets around this with sort because it does exceptions in the lexer. this is not > something that ordinary modules have access to. > > The user of reduce should use our($a,$b) to silence these warnings
Ether, you should be able to re-close this bug (it got auto-opened)