|Perl: the Markov chain saw|
Re: Another Array Problem.by aijin (Monk)
|on Dec 19, 2001 at 02:03 UTC||Need Help??|
There are a couple of things that aren't clear to me here.
First, why read the file into an array and then go through the array and split the lines. Are you sure any of the lines are splitting? When you while(<LOG>) you are reading the file line by line, which makes the split you've got in the foreach loop unnecessary.
Secondly, it's not clear what exactly you're checking, so I'm going to make the following assumptions. Please correct me if I'm wrong.
1. You want to check if all the entries in the @dst array are the same IP.
2. You want to know when there are 50+ of any service in the @service array.
Both of these tasks can be solved with the use of a hash. I suggest you meander over to the Categorized Questions and Answers section and read up on them.