[Bioperl-l] return undef

Nathan S. Haigh n.haigh at sheffield.ac.uk
Mon Nov 6 16:19:08 UTC 2006


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.

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?
e.g.:
use vars qw($variable1 @array1 %hash1);
# to:
our ($variable1, @array1, %hash1);

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?

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! :-)

Cheers
Nath

-- 
> A: Yes.
>> Q: Are you sure?
>>     
>>> A: Because it reverses the logical flow of conversation.
>>>       
>>>> Q: Why is top posting frowned upon?
>>>>         
Get Thunderbird <http://www.mozilla.org/products/thunderbird/>



More information about the Bioperl-l mailing list