> for my $host (@hosts) { > my %freq; > > $freq{$_}++ for grep /$host/i, @logfile; > > # open file > for (sort keys %freq) { > print "$_: $freq{$_}\n"; > } > # close file > } > > Voila.
I noticed that you use the default '$_'; as a matter of style/programming, what is preferred? Use of $_ or $scalar ? And thanks for the tips. ry -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>