window下读取某个文件,格式是:
open (filehand,"路径e.g:d:\\data.txt");
然后将打开的内容赋值给一个变量:
$protein=<filehand>;
附:一个读取蛋白质序列的程序。
复制代码 代码如下:
#!/bin/perl
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:\>