JPRED-2 Initial commit of software for the Jpred website (some files excluded due...
[jpred.git] / websoft / bin / get1stfasta
1 #!/usr/bin/perl
2
3 #
4 # Returns the first sequence from a FASTA file
5 #
6
7 use warnings;
8
9 if ($ARGV[0]) { open(IN, "<$ARGV[0]") or die($!); }
10 else { *IN = *STDIN; }
11
12 while (<IN>) {
13         if (/^>/) {
14                 print $_;
15                 while (<IN>) {
16                         if (/^>/) { exit(); }
17                         print $_;
18                         }
19                 }
20         }