in reply to Plusses obnox me
Will yield 'The+Police' - but that only gets the first space, if the string was 'Guided By Voices' then the result would be 'Guided+By Voices' - that's why you need to specify a global replace:my $str = "The Police"; $str =~ s/ /+/; # read between the slashes: space becomes + print "$str\n";
So, for your example you might want to store these values away before you print to your filehandle:$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 "<a href=nap ... (like you had before) print FILE "$escaped_artist - $escaped_title</a>\n";
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Plusses obnox me
by suaveant (Parson) on Apr 21, 2001 at 19:01 UTC | |
|
Re: (jeffa) Re: Plusses obnox me
by Anonymous Monk on Apr 21, 2001 at 09:45 UTC |