window下读取某个文件,他的格式是:
open (filehand,"路径e.g:d:\\data.txt");
然后将打开的内容赋值给一个变量:
e.g:
$protein=<filehand>;
下面是一个读取蛋白质序列的程序:
open (PROTEINFILE,"f:\\perl\\data.txt")||die("can not open the file!");
$protein =<PROTEINFILE>;
close PROTEINFILE;
print $protein;
结果如下:
F:\>perl\a.pl
MNIDDKLEGLFLKCGGIDEMQSSRTMVVMGGVSGQSTVSGELQDSVLQDRSMPHQEILAADEVLQESEMRQQDMISHDEL
MVHEETVKNDEEQMETHERLPQGLQYALNVPISVKQEITFTDVSEQLMRDKKQIR
F:\>