in reply to Re: char count windows vs linux
in thread char count windows vs linux
An alternate method of counting the number of characters in a file, including carriage return and line feeds, which should return the same result irrelevant of platform, would be:
print length do { local $/; local @ARGV = ( $file ); <> }, "\n";
Where the variable $file contains the text file name whose characters are to be counted.
Update
With regard to the follow-up post from Anonymous Monk, I would concur with the direction suggested of gjb in this post - It sounds as if there *really is* a difference between the files being compared on the two different machines (presumably as a result of the file transfer via FTP), hence the differing character counts.
perl -le 'print+unpack("N",pack("B32","00000000000000000000000111111110"))'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: char count windows vs linux
by aging acolyte (Pilgrim) on Dec 17, 2002 at 13:53 UTC | |
|
Re: Re: Re: char count windows vs linux
by Anonymous Monk on Dec 17, 2002 at 13:12 UTC | |
by derby (Abbot) on Dec 17, 2002 at 13:41 UTC | |
by jaa (Friar) on Dec 17, 2002 at 15:10 UTC | |
by gjb (Vicar) on Dec 17, 2002 at 13:21 UTC |