Mail Archives: cygwin/2002/07/23/01:57:53
This is a table of the results of my experiments with different
handling of \n by perl-5.6.1 and perl-5.8.0.
The code:
#!/usr/bin/perl
# sysopen(O, q/file/, O_WRONLY|O_CREAT|O_TEXT); # open line 1
# open O, q/>file/; # open line 2
# binmode O, ':raw'; # open line 3
print O "123\n567\n"; close O;
open I, q/file/;
while ( <I> ) { $string .= $_; }
print "String length: @{[length($string)]}\nFile size: @{[-s q/file/]}\n";
~
~
~
| Default | Force | Force
| | Binary | Text
|-------------|-------------|---------------------
|String| File |String| File |String| File
------------------|-------------|-------------|--------------------
| | | | | |
Win32 (perl-5.6.1)| 8 | 10 | 8 | 8 | - | -
| (Text) | | | |
------------------|-------------|-------------|--------------------
| | | | | | |
|perl-5.6.1 | 10 | 10 | 8 | 8 | 8 | 8
| | | | | | |
cygwin|-----------|-------------|-------------|--------------------
| | | | | | |
|perl-5.8.0 | 8 | 10 | 8 | 8 | 8 | 8(10)
| | | | | | |
The figure in parentheses is in the case where the file has a
'.txt' extension.
I still have to check the effects of the underlying mount mode
and of setting PERLIO. The default result with 5.8.0 and the last
result with the file extension are different from what I said I
got before, so a mistake in my testing is likely somewhere. Or,
could be related to what the underlying mount mode is.
--
Greg Matheson All teaching is teaching
Chinmin College under difficult circumstances.
Taiwan Penpals Archive <URL: http://netcity.hinet.net/kurage>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -