it's so easy to miss the error in: $line =~ s{ s+ \z }{}xms; when you expect to see: $line =~ s{ \s+ \z }{}xms; i wondered why one of the lines was having its last character stripped but the others were ok. /me goes to get more caffiene -- Live in a world of your own, but always welcome visitors.