in reply to How to slurp files and join lines

How about this: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> }; ?

UPDATE:
Oh ... you want to remove the newlines ... well, you could remove the newlines with a simple regex:

$string =~ s/\n//g;
or replace them with a single space:
$string =~ s/\n/ /g;
Although i am very curious as to why you would want to do that ... what are you going to do with the string afterwards?

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)