电脑在windows下写了一个perl脚本,是关于数据的的读取和输出的,但是在CMD上运行程序后没显示结果和报错
代码如下:#!/usr/bin/perl#readingproteinsequencedatafromafile#Firstwehavetoopenfileandasso...
代码如下:
#!/usr/bin/perl
# reading protein sequence data from a file
#First we have to open file and associate a "filehandle" with it, we choose the
#filehandle PROTEINFILE for readability.
open(PROTEINFILE, "pep.txt");
#first line
$protein=<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#second line
$protein =<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#third line
$protein =<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#now we can close the file
close (PROTEINFILE);
#代码应该没多大问题,在CMD上运行的结果显示如图 展开
#!/usr/bin/perl
# reading protein sequence data from a file
#First we have to open file and associate a "filehandle" with it, we choose the
#filehandle PROTEINFILE for readability.
open(PROTEINFILE, "pep.txt");
#first line
$protein=<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#second line
$protein =<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#third line
$protein =<PROTEINFILE>;
#print the protein onto the screen
print ("$protein");
#now we can close the file
close (PROTEINFILE);
#代码应该没多大问题,在CMD上运行的结果显示如图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询