#!/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 () { if (/^>/) { print $_; while () { if (/^>/) { exit(); } print $_; } } }