in reply to How do I remove spaces between sequences in a file

See $/ in perldoc perlvar. (And read this )

$/:  The input record separator, newline by default. This influences Perl's idea of what a "line" is.