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?
|
---|
In Section
Seekers of Perl Wisdom