I’m learning Perl by myself and I’m studying following book:
Beginning Perl for Bioinformatics
First Edition October 2001
I can’t pass the ‘Reading Proteins in Files’ section. However I try (for example I copy the exact program that is in the book) to open a file, it fails. The error message that appears in the screen is as follow:
“Readline <> on closed filehandle PROTEINFILE at C:\Documents and Settings\Administrator\Desktop\per.pl line 9.”
1. What’s the meaning of this message and how can I debug it?
2. Where must I create my file that I want to open it?
Aboozar Monavvar Feshani
Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I would recommend downloading the example code for that book from our website here - http://examples.oreilly.com/begperlbio/
It contains the file that the script is expecting to open - NM_021964fragment.pep
That should be placed in the same directory as the script trying to read the file.
I hope that helps,
I had the same problem.
Basically after you copy and paste the sequence into your notepad (assuming you are using windows), when you save it, you have to choose the option "all files" instead of "text documents" under the "save filetype" pulldown menu.
Hope this helps
Well i'm no very good typing english, but this error occurs because :
1.- The file 'NM_021964fragment.pep' must be in the same folder where you save the program.
2.- Check the filename of the file will be the same to NM_021964fragment.pep.
3.- the FileHandle PROTEINFILE perhaps can not read the variable $proteinfile or check all names of the variables.......
open (PROTEINFILE, $proteinfilename);
print "Here is the protein first Line: \n\n";
$protein = ;
print "Here is the protein Seconf Line: \n\n";
print "Here is the three line of the protein file :\n\n";