To make sure I am understanding correctly, I will try restating your problem:
- You have an existing key pair used by your "old linux machine".
- You created a key pair using PuTTY and PuTTYGen.
- You appended a blank line followed by the public key from PuTTYGen to ~/.ssh/authorized_keys.
- Old key works, new key fails.
Sound about right?
My initial troubleshooting of this issue would be along the following lines:
- First of all, I do not believe the blank line is the issue. (I tested this on my own system, and it did not seem to affect it.) You can also make the blank line a comment with a leading '#', just to see if that makes a difference. (I doubt it will, however.)
- Next, I would verify that the public key you entered into the authorized_keys file is present in its entirety. Assuming you copied the public key from the PuTTYGen interface, make sure that you copied the entire key from the window. (I have seen experienced admins get caught by this.) One way to ensure you all of it is to add a key comment, and verify that it is present in the public key string. (Also not a bad idea, so you can easily identify this key from others.)
- I would then verify that the key is a single line entry in the authorized_keys file. (Personally, I would probably move down the file in vi, but whatever way works for you.)
If that did not work, then I would begin looking at (or talking to someone who could look at) the logs on the server, to see if there is anything there that provided the next clue.
As far as the perl script on the Windows machine accessing the server, it is my understanding that can be problematic at best, so I would start by verifying your new key is working in PuTTY before tackling that.
Hope that helps.