in reply to An optimal way to induce CRLF using perlio

If you just want to replace LF by CR+LF, you can use substititution:
$message =~ s/\n/\r\n/g;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: An optimal way to induce CRLF using perlio
by perlron (Pilgrim) on Oct 26, 2014 at 21:51 UTC
    i tried hard coding \r\n into the string. I read online that the curl command sends data as ascii, so it wont interpret the \r\n as a CRLF. Thats when i thought of using the :crlf perlio approach i mentioned in the question.
    Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats
      Shell escapes are weak sauce, use system, use Capture::Tiny
      use Capture::Tiny qw/ capture /; my($stdout, $stderr, $exit) = capture { system '.../curl', ...',"\r\n\r\n..."; };;
        using system to execute the curl command was giving me the 2nd issue i spoke of.(malformed headers) . Luckily the post i mentioned advised back ticks which makes it work.
        will read about the other Capture::Tiny thing..Ok. thanks
        Do not wait to strike when the iron is hot! Make it hot by striking - WB Yeats