Re: 'while' confusion

2001-06-03 Thread Gerrit P. Haase
E. Alan Hogue schrieb am 2001-05-30, 20:56: Instead of this: > foreach $field (@fld_vals) { > while ($field = '') { you want that: == while ($field == '') { # '==' for ints, 'eq' for strings > push (@nulls,$id); > } > } > [...] > while statement was actually

Re: 'while' confusion

2001-05-30 Thread ___cliff rayman___
"E. Alan Hogue" wrote: > > > foreach $field (@fld_vals) { > while ($field = '') { i think u want an 'if' here. when you use a 'while', the program continues to loop if the condition is true. this usually implies you will do something to change the condition within the loop. since you a

Re: 'while' confusion

2001-05-30 Thread Me
> foreach $field (@fld_vals) { Means, iterate through @fld_vals. For each cell, make $field be an alias to that cell, then do the bracketed code that follows. So, if you assign to $field in the code that follows, you assign to the cell in the array too. The code gets done once for each cell. >

Re: 'while' confusion

2001-05-30 Thread Tony Cook
On Wed, 30 May 2001, E. Alan Hogue wrote: ... > foreach $field (@fld_vals) { > while ($field = '') { > push (@nulls,$id); > } > } > > My idea was that $id would be, for instance, the > primary key value so that I could go look at the > record later. > > Well, it didn't

'while' confusion

2001-05-30 Thread E. Alan Hogue
Hello, I'm new to this list and pretty much an absolute perl beginner. I'm really enjoying the list and would appreciate a little insight into the true meaning of 'while'. For some reason I'm having trouble using it. I was working on something today to help me find bad data in a text file. Among