my $file = "pp.txt" ; open (FH ,$file) || die ("could not openfile"); print join(" ", map { chomp; s/\+s$//; s/\@/\\@/; $_ } ),"\n"; close (FH);