in reply to read file into 1 line string
my $string = do { local @ARGV = $filename; join q{ }, grep $_ ne "\n" && chomp, <>; }; [download]
Althrough I think it would not give the desired output for an input file like this:
xxxxxxx xxxxxxxx xxxxxxxxx xxxxxx [download]