bioperl-live
bioperl-live copied to clipboard
Possible precedence issue with control flow operator at Bio/DB/IndexedBase.pm line 805
This warning has shown up for years --
https://github.com/bioperl/bioperl-live/blob/2b53e22cd3f61961ea9ac7707537a01e4bf75a73/lib/Bio/DB/IndexedBase.pm#L804
I don't remember the exact logic intended but should the return be inside the eval to avoid the ambiguity? Here's my proposed solution - anyone want to look and test - it seems to run okay when I change locally and am trying out in some limited tests.
eval {
return $self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
} or $self->throw( "Can't open file $file" );
Seems like the logic is to die if the File::Spec->catfile($self->{dirname}, $file)
call is performed; notably $@
isn't checked. I'm guessing it's okay to return from inside an eval, but I would do it something like the below, which is more explicit about the intent:
# completely untested
my $fh = eval {
$self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
};
$self->throw( "Can't open file $file: $@" ) if $@;
return $fh;
I am seeing this warning as well. It occurs for me when the current version of VEP (103.1) is installed using Bioconda, and VEP throws the warning at startup every time.
This warning has been around for years. No one has dug in to fix though I think. Should be harmless but let’s fix it ...
On Fri, Apr 23, 2021 at 8:06 AM Alan Hoyle @.***> wrote:
I am seeing this warning as well. It occurs for me when the current version of VEP (103.1) is installed using Bioconda, and VEP throws the warning at startup every time.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bioperl/bioperl-live/issues/355#issuecomment-825722074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAL5O44R3QO3COZ62T6AQTTKGEF3ANCNFSM4XDZJ2QA .
-- Sent from Gmail Mobile
Jason Stajich - @.***