in reply to Re^2: RE on lines read from in-memory scalar is very slow (cygwin and \n)
in thread RE on lines read from in-memory scalar is very slow

"My bet is that a string generated with plain "\n" behaves normal."

I went back and did an additional check on the data I used for my earlier tests. Each record in that test ends with just LF. For a specific test, I created two tiny files: check_lf which just contains "qwerty<LF>"; and check_crlf in which I forced a CRLF ending, its contents are "qwerty<CR><LF>".

$ for i in test_data test_data_Q check_lf check_crlf; do head -1 $i | +cat -vet; done XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$ QueryXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$ qwerty$ qwerty^M$

For anyone unfamiliar with "cat -vet", a newline is shown as a "$" and a carriage return is shown as "^M".

Edit: I changed several instances of NL to LF. This was for consistency with other parts of my post as well as LF being a generally recognised de facto standard (CRLF is more usual than CRNL).

— Ken

Replies are listed 'Best First'.
Re^4: RE on lines read from in-memory scalar is very slow (cygwin and \n)
by LanX (Saint) on Jan 24, 2024 at 21:40 UTC
    Sorry if I'm too tired to see the conclusion of these tests. (?)

    Are you saying that you reran them with different line endings, but the results were the same?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery