Hi,
I'm having a problem with some perl code in a template that's driving me insane! Please Help!
Initially, it all worked fine on an older version of Teamsite but the same template does not work on a newer version...
My template contains code that performs a http post to an external server using the LWP libraries like this (for this example I've replaced the actual URL with a GET to 127.0.0.1 which still fails):
$ua = LWP::UserAgent -> new();
$request = HTTP::Request->new('GET', 'http://127.0.0.1/');
$response = $ua ->request($request);
This used to work fine but on my new server fails with:
Can't connect to 127.0.0.1:80 (Cannot determine protocol)
I've tested LWP by calling lwp-request with a system call:
This also fails with error 500.
However, if I login to the teamsite server as the same user I use to access Teamsite and
manually run this from the console:
> lwp-request -m GET -eUS
http://127.0.0.1/I get a response fine.
Also, if I use LWP to get a local file from within a template it works fine.
What's different about the perl environment between being called from the console and called from a template that would break networking?