RE: Emptying Arrays

2005-07-06 Thread Jeff 'japhy' Pinyan
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

RE: Emptying Arrays

2005-06-28 Thread Ryan Frantz
>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

Re: Emptying Arrays

2005-06-28 Thread Jeff 'japhy' Pinyan
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

Emptying Arrays

2005-06-28 Thread Ryan Frantz
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