You can use
perl -pe 's/search/replace/g'
in place of
sed 's/search/replace/'
.. However ..
Those are meant for command line or shell scripts.
Since youre already in a perl script,
the correct answer was given by "Paul Tomblin" above.
Have fun,
eKerner.com