tradez has asked for the wisdom of the Perl Monks concerning the following question:
A simple, yet archaic answer to an issue that I know can be solved more easily. I was thinking about just using a system() call, sleeping, then checking it to see if I got results, but that would really not speed things up much. Please help me to find a better way!$fork = fork(); if(fork){ sleep 20; open (MYFILE, "traceroute$time.txt"); @data = <MYFILE>; if (!@data){ $error = 'Ip could not be Tracerouted'; push (@lines, $error); }else{ foreach $line (@data) { $line =~ s/\n/<br>/g; push (@lines, $line); } } }else{ $tracert = `traceroute "$ip" > traceroute$time.txt`; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A better way to test network elements
by Moonie (Friar) on Mar 07, 2002 at 18:45 UTC | |
|
Re: A better way to test network elements
by ajwans (Scribe) on Mar 07, 2002 at 21:34 UTC |