--- /dev/null
+#!/usr/bin/perl
+
+#
+# Returns the first sequence from a FASTA file
+#
+
+use warnings;
+
+if ($ARGV[0]) { open(IN, "<$ARGV[0]") or die($!); }
+else { *IN = *STDIN; }
+
+while (<IN>) {
+ if (/^>/) {
+ print $_;
+ while (<IN>) {
+ if (/^>/) { exit(); }
+ print $_;
+ }
+ }
+ }