in reply to Arrays merges and redundancies

The most natural way to generalize the code IMHO is to change to a loop over array references rather than treating each array individually - see perlreftut. You could put this all in a complex data structure (perldsc) rather than how you have it loaded now, but you could generalize what you have as something like:

if (($Entry > 0) && ($ID[$Entry] eq $ID[$Entry - 1])) { for my $ref (\@Value_1, \@Value_2, \@Value_3, \@Value_4, \@Value_5, \@Value_6, \@Value_7, ) { if ($ref->[$Entry] =~ m/($ref->[$Entry - 1])/) { $Placeholder = join(' / ', $ref->[$Entry], $ref->[$Entry - 1] +); delete $ref->[$Entry - 1]; push(@Value, $Placeholder); } } }

Of course, the above is buggy since your posted code was already buggy -- you've got index problems on your counter as soon as you start deleting elements, and that push isn't helping. Also note the added comma in your join. But the loop should answer your question.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.