Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tracerouting in perl

Status
Not open for further replies.

jvdboom

Programmer
Aug 18, 2002
93
BE
To view the route from a webserver(for windows) to a site I made this script.I uses the dos command tracert, however it's a very slow(but that's normal for tracert).but the script only shows the information at the end of the the tracert session (if i execute the script without a webserver I see the information when it comes avaible.
Is it possible to write to the browser when the program is still running?
#!c:\perl\bin\perl.exe

$test = $ENV{QUERY_STRING};

if ($test =~ /^url=(h?t?t?p?:?\/?\/?\w*\.?\w*\.?\w*\.\w*\/?~?\w*)/ ) {
open(TRACE, "tracert $1 |");
print "Content-type: text/html\n\n";
while(<TRACE>) {print $_ . &quot;<br>&quot;;}
close(TRACE);
} else {
print &quot;Content-type: text/html\n\n<h1>Error!!!</h1>&quot; }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top