in reply to Unique & sorted array optimization?

Why would you think that bloat needs to be corrected? The goal is not to pack the most functionality in the fewest lines of text. It is to produce a program that works and can be read.

Now that the flame-bait is out of the way, that for() loop should be a foreach loop so you can drop the $itr variable, warnings should complain that $r is not used, the my declaration for $lk should be moved inside of the loop to localize it as much as possible, and $_ does not need to be assigned to in the map. Lemme see, that gets you down to this:

my %UHash; foreach my $pic (@Linked_pics) { # Meant to pick the filename out my $lk = substr($pic, 1 + rindex($pic, '/')); $UHash{$lk} = $pic; } @Linked_pics = map {$UHash{$_}} sort keys %UHash;
Oops, I accidentally made it shorter. And clearer. In fact so clear that it is now obvious that if the format of the URL changes, your code will break.

I will let you fix that for yourself.