the first part of the post you are referring to tells you how to set $oldname and $newname to something sensible before you do the link/unlink operation. Granted there is a large comment in the middle, but that merely discusses an alternative method for setting $oldname and $newname.
Please read it again, you will see that you did come over correctly and they have indeed answered your question.
Nuance
In reply to RE: RE: Odd file rename
by nuance
in thread Odd file rename
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |