use strict; use warnings; use List::Util qw(first); my @countries = qw(India America Germany Austria); my $country = 'America'; print "True\n" if first { $_ eq $country } @countries;
That being said, I still think the hash solutions are better.
In reply to Re: Using the 'if' statement...
by toolic
in thread Using the 'if' statement...
by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |