Which gives:#!/your/perl/here use strict; use warnings; my @array1 = qw(dog cat rat mouse); my @array2 = qw(dog rat mouse bird); my @array3 = qw(cat rat fish mouse); my %seen; my @collection; foreach my $item ( @array1, @array2, @array3 ) { unless ( exists( $seen{$item} ) ) { push @collection, $item; $seen{$item}++; } } print "@collection\n"; __END__
I'll leave it to OMAR to come up with adog cat rat mouse bird fish
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: "Intelligent" array joining
by QM
in thread "Intelligent" array joining
by ngomong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |