in reply to More efficient Data Structure needed

Too much waste, lots of improvement you can make. At least you can add a last statement like this:
foreach my $record (@data) { foreach my $data (@m_info) { if ($record->[1] =~ /$data->[0]/) { $record->[1] = $data->[3]; $record->[1] = join ("", $record->[1], "_", $data->[1]); last;#jump out of the inner loop if you found the match } } }
Another suggestion is that, you can have both arrays sorted, then you only need to go thru both of them once, now we are talking about plus, no more multiply.

Well, of course sort itself will take up time. You have to make a decision base on the nature of your key.

In this kind of case, read a university text book would give you more help than a Perl book. I am serious.