#!/usr/bin/perl -w use strict; find_serv (); sub find_serv { @ARGV == 2 || die "usage: $0 INDEX_FILE '.com'\n"; my ( $INDEX_FILE, $com ) = @ARGV; my $list = "grep 'href=' $INDEX_FILE|" ; open (my $HAN, "$list" ) || die "Cannot open '$INDEX_FILE' because:: +$!"; while (<$HAN>) { chomp $_; my @array = split (/\//, $_); if ($array[2] =~ /$com/ ){ my $sorted = $array[2]; system (sort -u $scalar); # - doesn't work #print "$_\n" for sort { versioncmp($a,$b) } $sorted; }} } #END sorted file should look like www.google.ie www.icq.com www.....
In reply to how to sort uniq $array[2] by auto_w
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |