Oct 21, 2008, 5:48 AM
Post #1 of 6
help with filehandle
I'm trying to make my start to the Perl world with the help of a O'Reilly Book (Beginning Perl for Bioinformatics). So I'm at the (early) point of getting to know with filehandles and the example of the book (4-5 for those who read the book) is quite simple but cannot work on my MacBook for some reason...
Here is the script which can also be downloaded from the http://examples.oreilly.com/begperlbio/begperlbio_all.zip:
#reading protein sequence data from a file
#the filename of the file containing the protein sequence data
#first we have to open the file and associatea filename with it.
#we choose the file name PROTEIN FILE for readibility
open (PROTEINFILE, $proteinfilename);
#now we do the actual reading of the protein sequence data from the file by using the
#angle brackets < and > to get the input from the filehandle. we store the data into our variable
$protein = <PROTEINFILE>;
#now that we've got our data we can close the file
#print the protein onto screen
print "Here is the protein:\n\n";
I'm suppose to have the v5.8.8 built for darwin-thread-multi-2level version of perl.
the terminal gives the results shown at the attached picture.
can somenone help me please?