Hi, 

Jason B <[EMAIL PROTECTED]> wrote:
> I'm really new to programming and this is my first perl prog. 
>  I'm looking for any advice or comments on this script.

Enable warnings and "use strict;".

That'll help you to write better code.

> 
> #!/usr/bin/perl

#!/usr/bin/perl -w

use strict;

> #Name:circumf
> #Date:Jun19/08
> #Author:Bornhoft, J
> #Purpose:to calculate the circumference of a circle
> 
> print "Hi. I'm going to help you calculate the circumference 
> of a circle\n";
> 
> $pi = 3.141592654;

my $pi = 3.141592654;

With warnings enabled (perl -w or use warnings) you have to declare your 
variables using "my" on or before first use. The benefit is that this will help 
you to identify mistyped variable names and thus bugs in your code.

HTH,
Thomas

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to