Hir@ has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Program Comments
by almut (Canon) on Mar 21, 2010 at 10:35 UTC
    want to know that the comments written in the Proram below, are right
    52 sub display_results {        #calling a ssubroutine

    Strictly speaking, this isn't calling a subroutine; it's defining one.

    76 while ( $count)    #This subroutine waits for a UDP packet ...

    Likewise, while is a loop construct, not a subroutine.

    84 close WDW_FILE;     #closes the file

    Personally, I consider comments like this one superfluous... (but it's ok if the homework assignment reads "comment every line" or some such).

    (P.S. this list might not be complete...)

Re: Program Comments
by apl (Monsignor) on Mar 21, 2010 at 15:26 UTC
    Don't include comments (like #prints the initial value of $count before the while loop started at line 76) that refer to specific line numbers. Your program will change, and line numbers will almost certainly change. If it's important to keep track of a specific line, I suggest you use a label and refer to that.

    Before worrying about comments, though, I'd improve the formatting of the code...

Re: Program Comments
by jethro (Monsignor) on Mar 21, 2010 at 13:06 UTC
    use 5.6.0; # Change to 5.006_000 if using Perl 5.8.0. 3

    Not correct, this line will only check that the perl is at least version 5.6.0, it will not downgrade the interpreter

    Please, please, please edit your post to surround your code with <code> tags

Re: Program Comments
by Anonymous Monk on Mar 21, 2010 at 07:44 UTC
    Your sixth post looks awful, so I'll make this big for you

    Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!