in reply to Sorting issues

At the time that you extract your links and URLs, create a single array the looks like (note: UNTESTED):

@comb = ( [ 'ebay', 'ebay.com' ], [ 'yahoo', 'yahoo.com'], [ 'google', 'google.com'], );
This can be done, for example:
for ( @whatever) { # code that extracts URL and Link here push @comb, [ $link, Surl ]; }
Then you can say:
@bylink = sort {$a->[0] cmp $b->[0] } @comb; @byurl = sort {$a->[1] cmp $b->[1] } @comb;
Then create your separate lists if you need them:
@links = map { $_->[0] } @bylink; @urls = map { $_->[1] } @byurl;

The map and sort operations can be chained. (This uses concepts form the Schwartzian transform.) I may be confusing what you call link and what you call URL, but I hope you get the point.

--Bob Niederman, http://bob-n.com