in reply to Re: without looping, check if $var is found in @list
in thread without looping, check if $var is found in @list
I am implementing your code into an $sth->fetch. My results SORT OF work. The thing that's odd is if the very first fetch'd row does not match, NOTHING matches.
However, if I remove any @choice but the first element, all the others work as expected. @choice is populated from a forum field where the user selects a few options via checkboxes.
This behavoir is a little weird and I can't imagine what could be going wrong. Any ideas?while ($sth->fetch) { if( grep { $_ eq $name } @choices ) {
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: without looping, check if $var is found in @list
by graff (Chancellor) on Dec 14, 2006 at 05:06 UTC | |
Re^3: without looping, check if $var is found in @list
by Anonymous Monk on Dec 14, 2006 at 02:37 UTC |