in reply to RE on lines read from in-memory scalar is very slow

Not enough info!

Two possible guesses

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