Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

At the risk of sounded redundant...

by tedv (Pilgrim)
on Apr 10, 2001 at 00:56 UTC ( #71150=note: print w/ replies, xml ) Need Help??


in reply to (jcwren) Re: Still confused
in thread Still confused

At the risk of sounding redundant, wouldn't perl -w catch the use of $avg when undefined, thereby making the debugging easier? All the debug tips are great, but the best one is letting perl debug for you with use strict; and -w.

On a stylistic note, you might want to scope your variables like this:

my ($a, $b, $c, $d);
Instead of this:
my $a; my $b; my $c; my $d;
This should help keep your code from getting diluted with relatively less important text. (The computation is more important than the declarations, so it should also take up more space on screen to help focus your mind.)

-Ted


Comment on At the risk of sounded redundant...
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://71150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-08-23 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls