The perl line is creating a backup of the file (extension .backup) and doing a global search and replace on the given strings the output is then stored in the original file.
To do this in shell only:
Code:
# Shell only
cp -p $3 $3.backup
sed 's/$1/$2/g' $3.backup > $3
I've not played with perl enough to translate into a pure perl script.