while () { if ($_ =~ />/) #Header { if ($chr_num > 0) { my @str = split(undef,$temp_str); push (@genome,@str); } $chr_num++; print $chr_num . "\n"; $temp_str = ""; } else { my $temp = chomp($_); $temp_str = $temp_str . $temp; } }