[Bioperl-l] $_ assignment question

Jonathan Barber jon at compbio.dundee.ac.uk
Thu Jul 31 10:51:20 EDT 2003


On Thu, Jul 31, 2003 at 10:15:53AM -0400, Jason Stajich wrote:

[snip]

> > Usually it's easy to see why it's been done, but the problem comes with
> > some of the while() loops that use the 2nd idiom and have huge amounts
> > of code in them, including many method calls which could depend on $_
> > being set before being called (even though this would be a violation of
> > data hiding) and I'm too Lazy to check them without first asking.
>
> No reason not to change it - local($_) should be done.  If there are
> problems with someone being lazy enough to actually depend on $_ being
> set by a called method hopefully the tests will be good enough to pick
> them up.

That's good, I can hopefully just change them and see if make test
fails.

> Code audit & cleanup is enthusiastically welcomed.  Lots of things have
> been written by a pretty wide range of perl experience so anyone brave
> enough to start doing some systematic cleanups gets major beers points
> promised...
> 
> If you are going to be making a ton of changes I would rather they go to
> CVS directly than having to juggle hundreds of patch requests.  Give us a
> sense of what the magnitude of bug fixes will be if/when you dive in.

Around 294 files to correct indirect syntax, and 80 for localising $_.
These are approximate numbers from grep.
-- 
Jon


More information about the Bioperl-l mailing list