open my $fh, "<", "test" or die "test: $!" while (<$fh>) { chomp; $s .= " $_"; }