in reply to Unique entries from an array

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;