in reply to Quick and portable way to determine line-ending string?
Something like this...
If you don't have a writable file (why not a valid temp directory??!) use a filehandle tied to a text buffer. Say, IO::Scalar.open $foo, $tempfilename; print $foo "\n"; close $foo; # probably redundant, but why not. open $foo, $tempfilename; binmode $foo; read $foo, $result, 999; close $foo;
Hmm, I tried that and it didn't work, as I half-suspected. The binmode thing is done in the C Standard library functions, and Perl might be relying on that and have no real knowledge of what it means on a given platform.
Are you sure you can't come up with a writable file, or a fake file that operates on the FD level rather than Perl's tie level?
—John
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Quick and portable way to determine line-ending string?
by bikeNomad (Priest) on Aug 09, 2001 at 03:03 UTC | |
by John M. Dlugosz (Monsignor) on Aug 09, 2001 at 03:11 UTC |