sub get_country { my $data = shift; # let $data be one line of data, thus open IN, ">country.lis"; @country_list = ; # is file handle reading the country list; close IN; for $c (@country_list) { if ($data =~ m/(\w+)\s+$c\s+/) { next if (($c eq 'Mexico') && (lc($1) eq 'new' ) ); push(@my_bucket, $c); } } return \@my_bucket; }