未编译的 .pl 运行起来就像一条烫伤的狗。编译后的版本抛出:
Can't locate object method "simple_request" via package "RPC::XML::Client::new: Unable to get RPC::XML::Parser object" (perhaps you forgot to load "RPC::XML::Client::new: Unable to get RPC::XML::Parser object"?)
和代码:
#/usr/bin/perl
use strict;
use RPC::XML;
use RPC::XML::Client;
$VNEURL = "https://" . "$ConfIPHost" . "/api/";
$VNESession = RPC::XML::Client->new("$VNEURL", useragent => [ ssl_opts => {
verify_hostname => 0,
SSL_verify_mode => "SSL_VERIFY_NONE"
} ] );
$VNEAuthCookie = $VNESession->simple_request('login', 2, 0, $ConfIPUser, $ConfIPPass) or die("Failed to log in to IP360.");