in reply to Re: how to sort uniq $array[2]
in thread how to sort uniq $array[2]
well $scalar we can just disregard - i wanted to sort @array2 , that is where www.*****.com servers will be after split function
#!/usr/bin/perl -w use strict; find_serv (); sub find_serv { @ARGV == 2 || die "usage: $0 INDEX_FILE '.com'\n";# .com---->icq.com my ( $INDEX_FILE, $com ) = @ARGV; my $list = "grep 'href=' $INDEX_FILE|" ;#- $INDEX_FILE --> wget www. +icq.com open (my $HAN, "$list" ) || die "Cannot open '$INDEX_FILE' because:: +$!"; while (<$HAN>) { chomp $_; my @array = split (/\//, $_); if ($array[2] =~ /$com/ ){#matches icq.com my @sorted = $array[2]; system "sort -u '@sorted'"; #---not working }} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to sort uniq $array[2]
by JavaFan (Canon) on Jun 06, 2011 at 13:29 UTC | |
by auto_w (Novice) on Jun 06, 2011 at 15:00 UTC | |
by JavaFan (Canon) on Jun 06, 2011 at 18:36 UTC |