Tror faktiskt att open bara funkar på lokala sidor. Annars får du använda nån modul (eller skriva en själv) för att hämta hem index.jsp sidan till din server, och sedan öppna den.
Du måste öppna en socket-förbindelse till sajten och skicka HTTP-kommandon för att hämta sidan.
Den här metoden hittade jag på min hårddisk, vet tyvvärr inte vem som är upphovsman:
sub slurpURLcontent {
# local variables
local $hostname;
local $name;
local $aliases;
local $proto,
local $type;
local $len;
local $thisaddr;
local $thataddr;
local $sockaddr;
local $this;
local $that;
local @response;
# get parameters from parameter list
local ($them, $port, $url) = @_;
# get local hostname
chop($hostname = `hostname`);
# resolve protocol, port number
($name, $aliases, $proto) = getprotobyname('tcp');
($name, $aliases, $port) = getservbyname($port,'tcp')
unless $port =~ /^\d+$/;
# look up IP address for localhost
($name,$aliases,$type,$len,$thisaddr) = gethostbyname($hostname);
# look up IP address for server
($name, $aliases,$type,$len,$thataddr) = gethostbyname($them);
# create one endpoint of the communication link
die $! unless (socket(S,AF_INET, SOCK_STREAM, $proto));
$sockaddr = 'S n a4 x8';
$this = pack($sockaddr, AF_INET, 0, $thisaddr);
$that = pack($sockaddr, AF_INET, $port, $thataddr);
die $! unless (bind(S, $this));
# connect to server
die $! unless (connect(S, $that));
# force our socket to flush output immediately after a print
select(S);
$| = 1;
# make standard output the default again
select(STDOUT);
# get specified page
print S "GET $url\r\n";
@response = <S>;
# We strip off the HTTP header by looking for
# two newlines or two newlines preceeded with
# carriage returns. Different Web Servers use
# different delimiters sometimes.
#
$x = index(@response, "\r\n\r\n");
$split_length = 4;
if ($x == -1) {
$x = index(@response, "\n\n");
$split_length = 2;
}
#
# The following actually splits the header off
if ($x > -1) {
@response = substr($buf,$x + $split_length);
}
return @response;
}