On Jun 28, Ryan Frantz said:
for my $host (@hosts) {
my %freq;
$freq{$_}++ for grep /$host/i, @logfile;
# open file
for (sort keys %freq) {
print "$_: $freq{$_}\n";
}
# close file
}
I noticed that you use the default '$_'; as a matter of
style/progr
>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/pro
On Jun 28, Ryan Frantz said:
I'm working on a script that iterates over a log file looking for known
hosts so that their messages can be grouped in a summary report.
However, when I run the script, the array I create includes entries for
previous hosts that were found. I thought that I could em
Perlers,
I'm working on a script that iterates over a log file looking for known
hosts so that their messages can be grouped in a summary report.
However, when I run the script, the array I create includes entries for
previous hosts that were found. I thought that I could empty the array
at the b