http://qs1969.pair.com?node_id=220581


in reply to char count windows vs linux

Try following code

open(FILE, "$file"); $line; { local $/; $line = <FILE>; } @lines = split(/\015?\012/, $line); $count=(); foreach $line (@lines){ $count+=length($line); } print "\n$count";

Now you should obtain the same values on both systems. I think that the problem is with line endings. Is the crlf counted as one character?