At the time that you extract your links and URLs, create a single array the looks like (note: UNTESTED):
This can be done, for example:@comb = ( [ 'ebay', 'ebay.com' ], [ 'yahoo', 'yahoo.com'], [ 'google', 'google.com'], );
Then you can say:for ( @whatever) { # code that extracts URL and Link here push @comb, [ $link, Surl ]; }
Then create your separate lists if you need them:@bylink = sort {$a->[0] cmp $b->[0] } @comb; @byurl = sort {$a->[1] cmp $b->[1] } @comb;
@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.comIn reply to Re: Sorting issues
by bobn
in thread Sorting issues
by toonski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |