sub parseFile { my ($fIn) = @_; # a filehandle my $fastaData; ... #yada yada yada while (<$fIn>) { # $/ has not been undefined, $fIn is read line by line $fastaData = $_; $fastaData =~ s/\n//gms; #/gms are all useless because: #g - each time $fastaData will have exactly one \n (at the end) #m - regex doesn't use ^ or $, and it's always a single line anyways #s - regex doesn't use . and it's always a single line anyways # effectively performs the same function as # chomp($fastaData); # or even # chomp($fastaData = $_); ... } ... }