I am writing a perl code(windows) to traceroute IP address and to print the output.
Could anyone please supply the code.
I had executed the below code which was taken from cpan modules
#!C:/perl/bin/perl.exe
use Net::Traceroute;
$tr = Net::Traceroute->new(host=> "google.com");
if($tr->found) {
my $hops = $tr->hops;
if($hops > 1) {
print "Router was " .
$tr->hop_query_host($tr->hops - 1, 0) . "\n";
}
}
But it is generated as error message
C:\scripts>perl traceroute1.pl
No output from traceroute. Exec failure? at C:/Perl/site/lib/Net/Traceroute.pm
line 359.
Could anyone please help me in sorting this issue ?