in reply to reg perl substitution

Tie::File is a nice way to go; but, is this all your code needs to do? Is there more to this script (it would help if you used <code> tags around the script in your post)? If this is all you have to do, you might consider using the -i option to modify the file in place and do it in a one-liner,
$ perl -i.bak -ape '/^newyork/ and s/153600/7878787878/' test.cfg
I assume you want to match the first occurence of 'newyork' (there's two in the line), so I anchored the pattern. Modify to suit your needs. The '-i' will save the original file with a .bak extension and modify the file in place for you.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.