Check if networking is working on the machine and with Perl. The first error, "Bad protocol 'tcp'", only happens when it can't find the info on the TCP protocol. The second happens when it can't lookup the hostname.
Can you connect outside of Perl? Can you use "lwp-request" command to perform HTTP?