On Wednesday, May 1, 2002, at 04:35 , Teresa Raymond wrote:
> I'm trying to test @inlocation to make sure it is not null or filled in
> with a space but although I input via ckbox a value, the error msg is
> returned. I am not comfortable using the while or the $_.
>
> while (length @inlocati
L PROTECTED]>
Sent: Wednesday, May 01, 2002 8:03 PM
Subject: RE: $_ and while stmt
> You could use 'for' instead of 'while' in this case, I think. Example:
>
> my @inlocation = (one,two,three,four,five,six,seven);
> for (@inlocation) {
> if(($_ eq "two
You could use 'for' instead of 'while' in this case, I think. Example:
my @inlocation = (one,two,three,four,five,six,seven);
for (@inlocation) {
if(($_ eq "two") or ($_ eq "four") or ($_ eq "six")) {
print "$_ is an even number. \n";
}
else {
print "$_ is an odd number. \n";
}
}
Scot Ro