my $match = 'Ba'; my @array = ('Ba Ba Black Sheep'); if (grep(/^$match$/,@array)) { print 'exact match?'; } else { print "No match\n"; }
In reply to Re^5: Comparison between a string and an array
by edimusrex
in thread Comparison between a string and an array
by Eth443
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |