in reply to Re: Find a sequence in a multifasta files and motifs
in thread Find a sequence in a multifasta files and motifs
I have never seen the following before: if(!open(MY_HANDLE, "file.txt")){ Try to keep to what you might find in a text book.
TIMTOWTDI - if(!open(MY_HANDLE, "file.txt")){ die "Cannot open the file\n"; } is pretty much exactly* the same as open MY_HANDLE, "file.txt" or die "Cannot open the file\n";, but the former might be much more familiar to someone coming from a language such as C.
Personally I'd just have pointed out that generally the three-argument open and lexical filehandles have several advantages over the two-argument open and bareword filehandles, and that it's usually nicer to include the filename and $! in the error message.
* Update: One difference is that if introduces a new scope, which would become relevant when using lexical filehandles. But as currently written, they're the same.
|
|---|