my $str = "The Police"; $str =~ s/ /+/; # read between the slashes: space becomes + print "$str\n"; #### $str =~ s/ /+/g; # use this one ;) #### my $escaped_artist = $FORM{songartist}; $escaped_artist =~ s/ /+/g; my $escaped_title = $FORM{songtitle}; $escaped_title =~ s/ /+/g; ... print FILE "\n";