in reply to I don't understand error message

Sounds fairly straightforward.
Can't call next_hit on an undefined value, so therefore $result is currently undefined.

You set $result just above that line using:
my $result=$in->next_result;

So, the logical reason would be that next_result is returning undef. Perhaps because there are no further results to return.
You should check return values for error values before using them.

Replies are listed 'Best First'.
Re^2: I don't understand error message
by lomSpace (Scribe) on Jun 16, 2009 at 20:43 UTC
    There is only one result. So, I am not clear on how to define it? Any suggestions?
      You say there is one result, but the evidence (an undef being returned) indicates that there is not.
      If my $result=$in->next_result; is putting undef into $result there must be a reason for it. The key is figuring out what that could be.

      Since $in is a new Bio::SearchIO(...), you should look at that documentation to find the conditions under which next_result will be undef.

      I could guess and suggest that perhaps your file is empty, does not exist, does not have permission for you to view it, or even contains data in the wrong format.

      PS:
      Out of curiosity, why are you prepending ">" to the filename you are passing in? It seems unlikely that that would result in a valid file name.