in reply to Re: Unable to match newline
in thread Unable to match newline

Thanks for your reply. How can I do this in one line? (I mean without having to create a file with the code in it).

I apologize if this seems like a very basic question but my knowledge of Perl is very low.

Replies are listed 'Best First'.
Re^3: Unable to match newline
by Preceptor (Deacon) on Nov 20, 2015 at 16:04 UTC

    perl -0777 -e 'somecode' will slurp the whole file when you read it with a diamond operator. See perlrun - but single-liner-ing your code isn't always a good thing for readability and maintainability