[thelist] str_replace equivalent in Perl?

dave at stemfiction.com dave at stemfiction.com
Fri Feb 20 05:48:02 CST 2004


Hi all,

Is there an equivalent of PHP's str_replace function in perl? I've
googled it and found some mentions of it but they don't seem to work how
they should. Hadn't even looked at perl before monday but I'm working it
out as I go for this assignment we're doing.

I have data coming as POSTDATA from a form, and the text fields values
are coming through as word+word2, i.e. all spaces between letters are
replaced with a +. this is standard, and I'd do a:

str_replace ("+", " ", $variable_name); 

in PHP - can someone be so kind as to explain how to do it in perl?

thanks,
Dave


More information about the thelist mailing list