in reply to Remove SOME new lines

The -p flag treats the file one line at a time so your first regex will never match. Overcome this with -0:

$ cat in foo bar Ubar Ubaz quux $ perl -p0e 's/\nU/U/g' in foo barUbarUbaz quux $

Replies are listed 'Best First'.
Re^2: Remove SOME new lines
by RenMcCourtey (Acolyte) on Jun 29, 2016 at 09:35 UTC
    Oh boy, and I thought I was looking everywhere. Thanks a lot!