use strict; open FILE,"data.txt" or die "could not open data.txt: $!\n"; # set seperator to ">" local $/ = ">"; # chuck first one my $junk = ; while(my $record = ){ chomp $record; # do important stuff }