in reply to more than one condition to a while loop
I would suggest moving the exit test to the top of the loop. Text for unusual conditions, where it is clear what's happening, then, all else being out of the way, go on to main processing, knowing nothing unusual will happen.
If there are many conditions to check, this can get in the way of clarity, but certainly not here.
while ( <INFILE> ) { chomp; last if /^SEQRES[\s]{2,5}2/; # or my $num = /^SEQRES[\s]{2,5}(\d)/; last if $num == 2;
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|