[Bioperl-l] return undef

Sendu Bala bix at sendu.me.uk
Mon Nov 6 16:55:55 UTC 2006


Nathan S. Haigh wrote:
> Sendu Bala wrote:
>> Nathan S. Haigh wrote:
>>> Is there any reason why a "return undef" can't simply be swapped over to
>>> just "return"?
 >>
>> No, in fact if you see any 'return undef's, please change them to
>> 'return' since the former can lead to subtle bugs. We did do an audit
>> earlier to fix most of those; presumably there was some kind of issue
>> with the remainder (or they just weren't caught), so check that no
>> problems arise when you make the change.
> 
> Just been checking the bioperl-run modules and changed the ones I found.
> Running "make test" doesn't seem to show up any errors so I'll commit
> them shortly.

Thanks.


> On a similar note, is it safe to simply substitute "use vars" for "our"
> and correctly commenting the list of variables if qw() was previously used?

Should be. But note that we didn't officially agree on having the Run 
package require Perl 5.6... Is there a particular person who maintains 
the Run package, or does that fall to the pumpkin of Core?


> If so, there are 340+ "use vars" in the bioperl-run......any wise ideas
> on a generic script that can do an intelligent search and replace.
> Bearing in mind that these lists can span multiple lines?

It'll need a little futzing, just be very careful it is working 
perfectly before applying it to everything. All of Core and the other 
packages need the same work done on them...


> I set up the following page a couple of days ago to house some scripts
> that can be used to do audit checks of code:
> http://www.bioperl.org/wiki/Auditing
> 
> If anyone has any scripts, Perl, shell or otherwise fell free to add
> them! :-)

I created a one-off for the conversion to 'use base', but its a bit of 
delirium-induced hack. I'll add it when I get the chance; its 
essentially a more complex version of what you want to do. It also ought 
to be applied to all the other Bioperl packages...

(You should make mention of the existing audit scripts in CVS for 
bioperl-live in maintenance/)




More information about the Bioperl-l mailing list