Perl, Net::Traceroute::PurePerl return value
Posted
by
John R
on Stack Overflow
See other posts from Stack Overflow
or by John R
Published on 2011-11-15T01:45:08Z
Indexed on
2011/11/15
1:51 UTC
Read the original article
Hit count: 165
This is a sub routine that I copied from CPAN. It works fine as it is when I run it from the command line. I have a similar function from Net::Traceroute that also works fine AND allows me to return the string with a SOAP call. The problem comes when I try to return the ~string(?) from the function below with a SOAP call.
sub tr {
use Net::Traceroute::PurePerl;
my $t = new Net::Traceroute::PurePerl(
backend => 'PurePerl', # this optional
host => 'www.whatever.com',
debug => 0,
max_ttl => 30,
query_timeout => 2,
packetlen => 40,
protocol => 'udp', # Or icmp
);
$t->traceroute;
$t->pretty_print;
return $t;
#print $t;
}
The output looks like a string except the last part of the string looks like this:
28 * * *
29 * * *
30 * * *
Net::Traceroute::PurePerl=HASH(0x11fa6bf0)
I don't know what is different about Net::Traceroute::PurePerl that won't allow me to return the value with SOAP since the Net::Traceroute version does allow me to return it with SOAP.
© Stack Overflow or respective owner