"Adrian Farrell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> $answer = printf ("\nThe area of the circle with a radius of $radius is
> %2.2f\n", ($area));
>
> print "$answer"
If you want to store the string in a var, use sprintf. printf returns wether
or
> "Adrian" == Adrian Farrell <[EMAIL PROTECTED]> writes:
Adrian> The problem is that $answer returns a value of 1 and not the
Adrian> contents of the printf. I guess I've assigned it
Adrian> incorrectly. the other odd thing is that the -- print
Adrian> "$answer" -- line appear
Hi,
I've just written my first practice script from a book on learning perl.
it just performs a basic calculation of the area of a circle. out of
interest I decided I wanted the answer underlined and that the underline
should be the exact length of the answer. the script is shown below. The