"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 are not changing
$field within the loop, if $field does = "" then this program
will loop until the system runs out of power..
>
> 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 do what I wanted, but what really
> confuses me is what it actually did. When I went
> through the program in the debugger, it looked like my
> while statement was actually _assigning_ '' to each
> element of @fld_vals, thereby erasing the data in that
> array.
>
> Can anyone tell me why it did this?
'fo'r loops alias the index variable (default is $_, in this case it is $field) to
the elements in the array. this is a feature of 'for' loops.
check out:
perldoc perlsyn
/foreach
--
___cliff [EMAIL PROTECTED]http://www.genwax.com/