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 $
In reply to Re: Remove SOME new lines
by hippo
in thread Remove SOME new lines
by RenMcCourtey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |