in reply to Re^2: auto add a carriage return in front of a line feed, how to delete this auto character.
in thread auto add a carriage return in front of a line feed, how to delete this auto character.

but when comes to little-endian [...] it is still auto add a carriage return in front of a line feed

No it doesn't. Either it adds CRs before LFs or it doesn't. It doesn't know or care how the string was constructed. Something else changed.

open TARGET_FILE, '>', 'foo' or die; binmode TARGET_FILE; my @list = 10; my $outputstring = pack("v*", @list); print TARGET_FILE $outputstring;
>perl script.pl >debug script.out -rcx CX 0002 : -d100 l2 0B02:0100 0A 00 .. -q

PS — Why are you using a global variable (as in TARGET_FILE) for your file handle instead of a lexical? The former hasn't been required for 8 years.

  • Comment on Re^3: auto add a carriage return in front of a line feed, how to delete this auto character.
  • Select or Download Code