in reply to matching an array of alternates

This should do the trick:
@latin_am=("Ecuador","Mexico"); $regex = join ("|", @latin_am); open( FILE, 'input.txt' ) or die "input.txt: $!"; @lines = grep { /$regex/o } <FILE>;
@lines will hold all the lines of the file 'input.txt' that match any of the phrases in @latin_am