Perl, Net::Traceroute::PurePerl return value
- by John R
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.