Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Suppose I have an array @latin_am=("Ecuador","Mexico");
The actual array contains 10 countries.
I want to scan a text file for any line that matches /Ecuador/ or /Mexico/ or or any other country in the array.
What is the most efficient way of accomplishing this? Thanks very much.
The actual array contains 10 countries.
I want to scan a text file for any line that matches /Ecuador/ or /Mexico/ or or any other country in the array.
What is the most efficient way of accomplishing this? Thanks very much.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: matching an array of alternates
by btrott (Parson) on Jun 23, 2000 at 23:17 UTC | |
by Zoogie (Curate) on Jun 23, 2000 at 23:54 UTC | |
Re: matching an array of alternates
by takshaka (Friar) on Jun 24, 2000 at 07:23 UTC | |
Re: matching an array of alternates
by perlmonkey (Hermit) on Jun 24, 2000 at 02:27 UTC |
Back to
Seekers of Perl Wisdom