in reply to Re: Re: Re: char count windows vs linux
in thread char count windows vs linux

Sounds like you are doing a binary transfer to get your Win text file onto Linux.

Win uses two chars for end-of-line, and Linux uses one. If Linux returns an extra char per line, it is probably counting the ^M or \r that windows ignores as part of the line delimiter.

Option 1) use ASCII or TEXT transfer

Option 2) don't count the "\r" characters at the end of each line e.g.
$count= length($line); $count-- if substr($line,-1) eq "\r";