Perl Compiler Question

  • From: "Homme, James" <james.homme@xxxxxxxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 9 Sep 2009 15:18:06 -0400

Hi,
If I run the below program from the command line using simply perl program.pl, 
I get no compiler errors. If I put the file into EdSharp and press Control+F5 
to compile, the compiler complains that I'm using uninitialized variables. 
What's the difference?

Here's the program.

#!usr/bin/perl
# circle.pl
# Compute the circumference of a circle.
use warnings;
use strict;

my $pi = 3.141592654;

print 'Enter the radius:';

chomp (my $radius = <STDIN>);
my $circumference = 2 * $pi * $radius;
if ($circumference < 0) {
  $circumference = 0;
}

print "\nThe circumference is $circumference\n";

Thanks.

Jim

----------
Jim Homme
Usability Services
412-544-1810
james.homme@xxxxxxxxxxxx

"Strength does not come from physical capacity. It comes from an indomitable 
will." -- Mahatma Gandhi


________________________________
This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.

Other related posts: