You could try something like this:
Rough code, untested. Your data may allow some simplification.my %numbered; foreach my $string (@a) { for ($string =~ /(\d+)/g) { push @{$numbered{$_}}, $string; } } my @occurances; for (@b) { push @occurances, @{$numbered{$_}} if exists $numbered{$_}; }
After Compline,
Zaxo
In reply to Re: comparing element in arrays
by Zaxo
in thread comparing element in arrays
by smoss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |