#strip off carriage returns $line=~s/[\r\n]+$//s; #next if the length of $line is zero next if length($line)==0;