in reply to Net::OpenSSH key authentication
I'd guess that your script is looking for the key in the wrong place when you're calling it as cgi. Turn on debugging ($Net::OpenSSH::debug |= 16;), it should tell you the exact ssh line it is trying to call. Try that manually and see whether you find the problem that way.
All dogma is stupid.
In Section
Seekers of Perl Wisdom