Use perl instead of GNU sed; fix spelling error

* Use Perl to replace configuration variables in place instead of GNU sed to
  help some poor souls without a proper GNU installation. This solves
  ticket:1403, thanks to sthen for the report.
* Also fix my previous spelling error: substitue vs. substitute. Again thanks to sthen :)
Merge pull request #148 from mattthias/stable-2.0_fix_for_ticket_1403

Use perl instead of GNU sed; fix spelling error