One simple way is to use each filename as the key in a hash.
my @images; # array of filenames my %img; # hash used temporarily $img{$_} = 1 foreach @images; # stick them in a hash @images = keys %img; # now only unique filenames
A slightly fancier way using grep that preserves the original order:
@images = grep { ! $img{$_}++ } @images;
In reply to Re: Unique entries from an array
by gmargo
in thread Unique entries from an array
by CoffeeGuy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |