Thank you all for you prompt and accurate help.  I will not soon forget the
difference between assigning a value and a numeric comparison operator.

Jason, with the "@a=$number" statement, I was trying to create the list by
changing contexts.  In other words, if <STDIN> returns the input in a scaler
context and "@a=<STDIN>" places each line in a list context (thereby
changing the context), I thought "@=$number" would work.  I was wrong.  The
"push" works great.  I have much to learn about contexts within PERL.

"Rambog" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am attempting a program that reads a list of numbers from the screen
until
> the number 999 is read.  It then prints the sum of all numbers read- with
> the exception of the 999.
>
> My code looks like:
>
> until ($number=999) {
> print "Please input your number:\n";
> chomp($number=<STDIN>);
> @a=$number;
> }
> foreach $i (@a) {
> $c+=$i;
> }
> if ($number=999) {
> print "Your total is: $c\n"
> }
>
> The program immediately terminates with and the line "Your total is:" is
> output with a  a blank value.  It never even prompts me to input a number.
> What am I doing wrong?
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to