in reply to How to test for a new line

I'd do something like (untested)

my $myvar; { local $/ = undef; if ( ( $myvar = <FILEPTR> ) =~ s/\n+//g ) { alert_user(); } }
If you don't care to alert the user when newlines are found, then replace the if block with
( $myvar = <FILEPTR> ) =~ s/\n+//g;
The line
local $/ = undef;
essentially turns off line-oriented input, and reading from the handle gets the whole string.

If you want to preserve the last newline (and just get rid of the embedded ones), use this regular expression instead:

s/\n+(?!\z)//g

the lowliest monk