哪里出错了,运行结果跑到了SHELL提示符后?

哪里出错了,运行结果跑到了SHELL提示符后?

哪里出错了,运行结果跑到了SHELL提示符后?
程序欲处理处理下面文件,实现>号后去除所有的序列(ATCG)部分前后各20个字母,然后按原格式输出(文件内容为大量些重复数据,且每条数据均为>开头,下面一行起为序列开始,结束至下一个>前),请高手帮忙看看哪里出了错?
要处理的文件:
[quote]
>OSI9Ba0010P05.r.scf 1467 0 1467 SCF
TTTTTTTTGCTTTTCCCGGGGCTCGGTATTGTTTGTNGTNGGAATTNGTN
NGAGCGGATAACAATTTCACACAGGAAACAGCTATGACCATGATTACGCC
AAGCTATTTAGGTGACACTATAGAATACTCAAGCTTGTCAGTCAAAGCAT
TGAATAAACCTTGTGTATGAAGCTTCACTTTATCAAAGGGTACATTCCAT
CTTAATTATGCCGCAAACTGTTCCTAATTATGCTCTGTCTCATCTCAAAC
CAAAGAGAATAGGCATATTTGCTAATTCCTATGCTACTCATGGAAAACCT
ATCTTTCTGGCTTCCCTACCATCTGAATCTTGCACAAGTGACCATATGAT
AGCCTTGAGTTGTCATTGTTTAATCACAATCAGCTTAATCCAGTCCATAC
ATGAGAAGATTGTGATTAGATAAGACCTAGGGTCATGCAAGGCAAGCCAA
AAGGGTTGGGTAATCAAAGACAATGGTCTAATACAAATTGCATGAATTGC
TCCATTTGGCATATTGTTATAGGTTATTGTTTAATGAATATTAAGCGGTC
CAAGATGTGTTTTTTTTCTTGCTGAACAAATTGAATTAGAGGTTAATGAT
GAATGGGATTAAAACAATGTGAAGTAAAAACTAAAGATTGAGAGGTAATA
AATTAATTAAATGGGAAATAAAAATTGTATGGCCTGAAAAAAAATCCTAT
ATAGCACCGGAATGTAAAAAGGGCCTGGACCTCTCCTTTCTTGGAAGGTT
CCCCCATTCAAAAATAAGCCATAAGCAAACCCCCAACCTAAAGCCAATAA
GAAATTTAATAAGCGCCCCAAAAGAAAACCAACCTCCCGCCCCCCACAGA
AAGCCCGCCCATTTTTGAAAACTTGGGAATGGTTCCTTTTAATATTTTGG
AAAATTCCCGCAAAAAGTTGCTAAATTGAAAATTTGCTTTTTTTTTTTTA
TTCCAAAAAAAAACGAAAAGATTGTAAAAAAAAAAATTTTTCCCCTCCTG
GAGTTTAAAGCATAGAAAAGGAGGGGCCCCAAAAAAAAAAAATAGGGGGC
TTTTCCCCCCCCCCTTTTTTTTTATAGGGGGGGAAAACCCCCCATTTGTG
CCCCAAAAAAAAAATTGGTGAAAAAAAATATTTTTCCCCACCACGAAAAA
AAAAAAAAAATATTTTTTTTTTGTTAAAAAGAAAAAAAGAGGCCACCACA
TGATGTCCCCCCTCCTTCCCCCAAAAAAAGAAAAAAAAAAAAAATTTCTT
TTTTTTTTGAAGAGAAAAAAAAAAAAGAAGGAGAGAAAAAAAAAAATAAA
AATATATATCTCGGCCGTCCCGGCACACCCCCCACCACAAAACAAAAAAA
AAACAATAAAAAAAATATATAATATAACTTCTCTCCCTCGGCGGGGGGCG
GGGAGGGCGCGGGGGCGGGGGGGGGCGGGGGGCGGGGGGGGGAGGAGAGA
GGAGGAGTGGTGTGGGA
>OSI9Ba0006D21.r.scf 1431 0 1431 SCF
CCCGGGGGGAACCCCTAGAGTCGACCTGCAGGCATGCAAGCTTGCATGGC
AACGGGCTGGATCCGGGCCCTCCCACGCCAGATCCCGCTGGGAGCGACGA
AGAGGTCACCGCGGCCGATGGCTGTGGACAAGAGGACGACGGTGGCGAGG
CTGGCTCGGTCGGTGGCGGCAAGAGGCCACGGGTACAGAGAGCTGGCACG
GACAATGCTCCGAGTGACCAGTGGTGGCATGAGGAGACGGGCGCGAGGCG
ACAGTGATGTGGGCGGGCGGCTTGAGGCGGGGGTGCCGTGGGTCATCTGG
ATGAGGTGGCGGCGATAGTGGTATCGTGAGGTTGGTGCAGGAGACCTGTG
……………………[/quote]
[code]
#!/usr/bin/perl
if(!@ARGV){print "Usage: perl $0 <INPUT_FILE>!\n";exit;};
open (FILE,"$ARGV[0]") || die "$!";
while(defined ($line=<FILE>)){
if($line =~/^>/ ){
print"$line";
while(defined ($line=<FILE>)){
if($line!~/^>/){
chomp($line);
print "$line++++";
$seq=$seq.$line;
}elsif ($line=~/^>/){
# $seq=join("",@array);
#$length = (length ($seq))-20;
$length = (length ($seq))-20;
$tem=substr($seq,20,$length);
print "$tem\n";
seek (FILE,-100,1);

last;}
else{}

}
}
}
close (FILE);
[/code]
运行结果:
[code]
perl remove-before-and-after-seq-20bp.pl seqs.txt
>OSI9Ba0010P05.r.scf 1467 0 1467 SCF
GGAGGAGTGGTGTGGGAGGGGGGGGCGGGGGGCGGGGGGGGGAGGAGAGAGAGA
>OSI9Ba0006D21.r.scf 1431 0 1431 SCF
CTCATCCTCGTTGTTTCTAATATAATATATGTGGTGTAGCTCCCCCGCCCGCCC
>OSI9Ba0007A03.f.scf 1367 0 1367 SCF
AAATAACCATATTTTTCAATTATTTTTTTTTGATTTTGGTTGGTCTGCCAGCCA
>OSI9Ba0001A04.r.scf 1966 0 1966 SCF
GTCACACTTGCTGTNNGTCTAGNCAACGAACTGATCTGGAATTGTCGTGCGTGC
>OSI9Ba0006D16.f.scf 0 1373 SCF
TATTTATTGAGTTTTCTGGCTCTTAATGTTCTTATCGGCCAAGGTGTGCATGCA
>OSI9Ba0006O24.f.scf
++++[biozy@node11 ncTarget]$ TGTGCGTGTCTTTTGTGCTTTATTG
[/code]
$line++++ 加个 \n.