Not much alteration but hope i could jus help you out. i have just tried to get the output and omitted the time. And as Darren said Net::Traceroute is also a very good option.
a small change to your code
use strict; my $host = <STDIN>; chomp($host); my @data = &traceroute($host); print " Data :@data \n"; sub traceroute() { my ($ht) = @_; open EXE," traceroute -m 10 $ht |" or die " Error Running command + $! "; my @output = <EXE>; close(EXE); ##print " Data : \n @output \n"; return (@output); }
In reply to Re: Timing out a traceroute
by msk_0984
in thread Timing out a traceroute
by vancetech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |