First, to clear up any ambiguity, I'm going to call the ASCII character with a hex code of 0A and a decimal code of 10 a "LF" .
I'm also going to call the ASCII character with a hex code of 0D and a and a decimal code of 15 a "CR".
I want to be able to print just a "LF" to a file. As a simple test case:
open TEST, ">", "test.data";
select TEST;
print "A" . chr(hex("0A")) . "B" . "\n" . "C" . "\r" . "D";
close TEST;
Logically, when I look at the test.data file with a hex editor I'd expect just a "LF" between the A and B, but instead there are is a "CR" followed by an "LF."
For reference here is the hex output of my test script and the equivalent chars below the hex number:
41 0D 0A 42 0D 0A 43 0D 44
A CR LF B CR LF C CR D
I was expecting only a "LF" (i.e., 0A) between the "A" (41) and "B" (42) ...
If it helps this is Perl 5.8.8 (ActiveState Perl Build 820) on Windows XP.
Thanks for any advice you may be able to give me.
I'm also going to call the ASCII character with a hex code of 0D and a and a decimal code of 15 a "CR".
I want to be able to print just a "LF" to a file. As a simple test case:
open TEST, ">", "test.data";
select TEST;
print "A" . chr(hex("0A")) . "B" . "\n" . "C" . "\r" . "D";
close TEST;
Logically, when I look at the test.data file with a hex editor I'd expect just a "LF" between the A and B, but instead there are is a "CR" followed by an "LF."
For reference here is the hex output of my test script and the equivalent chars below the hex number:
41 0D 0A 42 0D 0A 43 0D 44
A CR LF B CR LF C CR D
I was expecting only a "LF" (i.e., 0A) between the "A" (41) and "B" (42) ...
If it helps this is Perl 5.8.8 (ActiveState Perl Build 820) on Windows XP.
Thanks for any advice you may be able to give me.