in_array() in Perl?

I was looking for this useful function I always use in php and found this simple article. Basically, the function that permit you to do that is **grep **used in this way:

my $string = ‘fin_helm’;
my @array = qw/full_plate manteau boots two_handed_sword fin_helm/;
if(grep $_ eq $string, @array)
print “$string is in the array”;


comments powered by Disqus