in reply to Re^2: Perl6: Capturing newline in a string
in thread Perl6: Capturing newline in a string

That's a nice way to learn about Perl 6. :-)

I'll take a look at your module and see if I can have an idea which may help you.

Update: fixed a typo.

  • Comment on Re^3: Perl6: Capturing newline in a string

Replies are listed 'Best First'.
Re^4: Perl6: Capturing newline in a string
by stevieb (Canon) on May 31, 2016 at 16:43 UTC

    Thank you very much :)

    Let me know if you have any questions (or suggestions/feedback).

      Hi stevieb,

      Just a bit of feedback. I have tried a number of things and combinations (such as using the :bin and chomp => false options, using the lines, slurp, slurp-rest and get functions or methods), etc., but to no avail. Even when requested to keep new lines, Perl 6 is apparently converting \r\n sequences to \n on reading a Windows file, so that "un-chomped" lines end with \x0A (or ASCII 10), whether they come from a Unix or a Windows file. There doesn't seem to be a possibility to distinguish between EOL conventions this way. Or, at least, I haven't found any.

      Not a good news, and unfortunately not very helpful, but I thought I should let you know about my tests.

        It's very helpful Laurent_R, thanks! Combined with what raiph said in Re^3: Perl6: Capturing newline in a string that I've reviewed, I'm thinking this is a bug (or at least a function that's lacking... I can't see me being the only person who will want to identify which endings a file has, as perl6 takes off).

        There should be a way to get this information, or else there's no way to ensure the proper line endings get replaced (by proper I mean the original ones) when the endings aren't that of the local platform.

        I'm going to do a bit more testing and review. If I can't figure anything out, I'll open a ticket.