in reply to A better understanding of while () loops
or:elsif ( $input ne 'good' and $input ne 'bad' and $input ne 'iffy' ){ next; }
or consider a lookup hash:elsif ( $input !~ /good|bad|iffy/ ){ next; }
my %lookup = ( good => undef, bad => undef, iffy => undef, ); # and then within your loop next unless exists $lookup{$input};
update: added a missing brace
update 2: changed =~ to !~ in second snippet
|
|---|