Sorry: my comments here should have gone under Reaped: Testing the network connection, as this thread may be deleted. I was slow in parsing turnstep's instructions. Your program has been critiqued regarding the virtues of ICMP over HTTP as the protocol for testing connectivity. As correct as that point is, I think folks should keep in mind that your program provides a naive benchmark that answers a non-technical complaint thatyou got from your boss. He wanted to know "What's wrong with our stupid ISP? Yahoo! is slow as molasses today."
Together with traceroute|tracert your program provides triangulation for answering your boss's question, and lays it out in a compelling snapshot. I would bet that if you combine the output of traceroute into your program, you will have answered your boss's content and performance question more to his satisfaction than if you had only tested connectivity. Put a button on his "Active Desktop" and he'll push it several times each day, I would guess.
For my criticisms, mostly opinions, consider:
- CGI does write all of the tags that you put into your script. I think you should use it fully - so that
all improvements to CGI will be automatically written into your program.
- You've made a good choice dividing the program into two,
in my opinion. But, the advantages of doing so are lost when you hard-code the data. Separate out the data into an initialization file, or collect it from a form. (Update to clarify: at very least, pass the array @sites rather than
cut and paste it.)
- in my opinion it's better to write your open || die statement
as
open INFILE,"$datafile" or die
"Cannot open $datafile :$!";
The perlops || and or are
identical in their short-circuit behavior, but the latter
has the advantage of being more legible and having a much
lower precedence (notice that it can even be used without
parentheses preceding). In my opinion it's better suited
to the open() test. I think it belongs in
our perl vocabulary, for these reasons.
Thanks for posting your program, cajun. mkmcconn
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|