my $line = do { local $/; <$fh> }; $line =~ s/\n*\n/ /g;
Or:
my $line = do { local $/; <$fh> }; $line =~ tr/\n/ /s;
Or just:
( my $line = do { local $/; <$fh> } ) =~ tr/\n/ /s;
In reply to Re^2: read file into 1 line string
by jwkrahn
in thread read file into 1 line string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |