in reply to Using the 'if' statement...
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.
|
|---|