Am I missing something?Yes, you are ignoring important warnings because you did not use strict and warnings.
One way to search an array for a specific value is to use grep. I think you are looking for something like this:
use strict; use warnings; my @array = qw( ciccio paperino palla gigio pluto ); my $test = 'pluto'; if (grep { $test eq $_ } @array ) { print "It matched!\n"; }
In reply to Re^3: Regex and array
by toolic
in thread Regex and array
by Deus Ex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |