在串聯或串在Convert1.pl使用未初始化值$Xentr4
的第6行什麼是造成這些錯誤? (。)
我得到以下錯誤:
Error opening no such file or directory at Convert1.pl line 6"
#!/usr/bin/perl -w
# This script takes a user specified interleaved fasta input file $ARGV[0] and converts it to a sequential fasta file
use strict;
my $Xentr4=$ARGV[0];
open(IN, "<$Xentr4") || die ("Error opening $Xentr4 $!");
my $line = <IN>;
print $line;
while ($line = <IN>)
{
chomp $line;
if ($line=~m/^>/) {
print "\n",$line,"\n";
}
else {
print $line;
}
}
太好了,解決了!下一個問題 - 將結果輸出到文件(而不是僅打印)的最佳方式是什麼? – Paul 2013-02-17 19:32:18