Suggestions other than grep -b3 :-)
Robin Berjon
robin.berjon at expway.fr
Thu Apr 13 16:58:17 BST 2006
On Apr 13, 2006, at 16:31, Jacqui Caren wrote:
> Simon Wistow wrote:
>> About the only thing I could suggest was either writing a Debugger
>> or using PPI.
>
> a grep -b3 took 30 seconds to write and caught ~20 of the lill
> buggers.
>
> I was hoping someone would mention a "use lint" or similar :-)
I would think that any regex that detects duplicate uses of the same
variable name following my in the same file, and then weeding out the
common ones ($i, $self) would find them all with minimal false
positives. If there's a lot of variable name reuse, then checking
that there isn't a "^sub " between the two should kill the remaining
false positives.
Another option might be to use one of the B:: modules to walk all the
pads and check that there isn't any variable shadowing. Might be a
bit painful though.
--
Robin Berjon
Senior Research Scientist
Expway, http://expway.com/
More information about the london.pm
mailing list