Funny, but he's a shitty perl programmer
He should start the script with a shebang or a package definition (or comments, etc). He should also be scoping the vars explicitly - this script wouldn't survive 'strict vars'. Plus, who uses Notepad?
It actually looks like it was doing a good job of trying to figure out what he was saying.