in reply to Sorting issues

Associate the two with a hash,

my %location; @location{@links} = @urls; print $_, ': ', $location{$_}, $/ for sort keys %location;
or else make an AoA of them,
my @locations = map {[$urls[$_], $links[$_]]} 0 .. $#urls; print join(': ', @$_), $/ for sort {$a->[1] cmp $b->[1]} @locations;

After Compline,
Zaxo