in reply to checking the matches
Ikegami already provided a very compact solution using a hash. A more explicit (looped) variant would read like:
... for my $element (@array2) { my ($num, $txt) = split /#/, $element; # extract parts print "$txt = $num\n" if grep $num eq $_, @array1 # use text compa +rison and print txt part } ...
Regards
mwa
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: checking the matches
by tweetymonk (Initiate) on May 22, 2008 at 10:47 UTC | |
by mwah (Hermit) on May 22, 2008 at 10:54 UTC |
In Section
Seekers of Perl Wisdom