... or use List::Util andmy $select = param('select'); my $found; foreach (@display_files) { if ($_ eq $select) { $found = 1; last; } }
Annomy $select = param('select'); my $found = List::Util::first { $_ eq $select } @display_files;
Update: Code corrected, thanks pKai.
In reply to Re^2: Just 1 line explanation
by Anno
in thread Just 1 line explanation
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |