in reply to read file into 1 line string

my $string = do { local @ARGV = $filename; join q{ }, grep $_ ne "\n" && chomp, <>; };

Replies are listed 'Best First'.
Re^2: read file into 1 line string
by hperange (Beadle) on Apr 21, 2012 at 14:48 UTC
    Nice solution :)

    Althrough I think it would not give the desired output for an input file like this:

    xxxxxxx xxxxxxxx xxxxxxxxx xxxxxx