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
In Section
Seekers of Perl Wisdom