Re: Debug some simple code

2002-01-31 Thread Rambog
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 returns the input in a scaler cont

Re: Debug some simple code

2002-01-31 Thread Jeff 'japhy' Pinyan
On Jan 31, Rambog said: >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) { You want ==, not = here. >print "Please inp

RE: Debug some simple code

2002-01-31 Thread John Edwards
6:10 To: [EMAIL PROTECTED] Subject: Debug some simple code 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 "Pleas

RE: Debug some simple code

2002-01-31 Thread Hanson, Robert
AIL PROTECTED]] Sent: Thursday, January 31, 2002 11:10 AM To: [EMAIL PROTECTED] Subject: Debug some simple code 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 l

Re: Debug some simple code

2002-01-31 Thread Roger Morris
At 11:09 AM 1/31/2002 -0500, you wrote: >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 numb

Re: Debug some simple code

2002-01-31 Thread Jason Purdy
A couple of things here ... 1) Watch out for = vs. == ... very tricky! Your first until loop won't even eval b/c $number=999 is always true. 2) @a=$number; is not what you want... I'm not even sure what that does. You probably want to use the push function, like so: push @a, $number

Debug some simple code

2002-01-31 Thread Rambog
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=); @a=$number; } foreach $