Re: Perl Compiler Question

  • From: "qubit" <lauraeaves@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 9 Sep 2009 15:23:43 -0500

Does it give you a line? Maybe it doesn't like the declaration of radius on the 
call to chomp.
--le

  ----- Original Message ----- 
  From: Homme, James 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Wednesday, September 09, 2009 2:18 PM
  Subject: Perl Compiler Question


  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: