[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Perl Problem No. 1



Sayeth the Llama: Write a Perl script that prompts the user to enter
the radius of a circle, then calculates and prints the circumference.

Typith Harold

  #! /usr/bin/perl
  print "Enter the radius of the circle.\n";
  $radius = <STDIN>;
  print "The radius is $radius.\n";
  ...

But when I run the script and enter a value of 4, the output is

  The radius is 4
  .
  $

I looked at the solution in the back of the book, and the author's
output line is identical to mine.  Why is Perl moving the period to
the start of a new line?

- Harold

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.