In fact I unit tested this for variety of cases when I posted it here based on PrakashK's solution. ;-)
As such the problem probably arises from the fact that the Dos newlines are being converted to "\n" when they are read. Try to binmode() the file handle and run the program again.
open my $fh, "+<$file" or die "$!"; binmode $fh; ...
--
John.
In reply to Re: File Truncation Problem
by jmcnamara
in thread File Truncation Problem
by The_Rev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |