in reply to Re: An optimal way to induce CRLF using perlio
in thread An optimal way to induce CRLF using perlio

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
  • Comment on Re^2: An optimal way to induce CRLF using perlio

Replies are listed 'Best First'.
Re^3: An optimal way to induce CRLF using perlio
by Anonymous Monk on Oct 27, 2014 at 00:56 UTC
    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

        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

        Um, `` aka qx// goes through the shell -- you don't want to go through the shell (its shell programming), you have to quote and escape characters, and you aren't doing it correctly ( String::ShellQuote)

        system, the list form I gave, does not go through the shell, so you don't need shell escapes

        Yes, you can give curl nonsense using both of these, the shell (qx) and directly(system) ... stick with system so you only have to deal with perl string escape/quoting rules