I found the error. Sorry to answer my own queston
I was trying
(@bad,@good) = split(/ /, $string);
when i needed
($bad,$good) = split(/ /, $string);
thanks for all the help.
jd
On Mon, 2003-03-31 at 16:18, jdavis wrote:
> >
> > ($left,$right) = split(/word/, $sentence);
> >
>
> I am trying this but its not working. Im lost :)
> could someone take a look...
>
> This is the beggining of a scrip to make reports
> based on droped iptable packets
>
> thanks
> jd
>
> #################################################
>
> #!/usr/bin/perl -w
>
> $file = '/var/log/messages';
> open(FILE, "$file") || die "cant open messages";
> @log = <FILE>;
> close(FILE);
>
>
> ## get lines from Messages for iptables - IPT
> foreach $log (@log){
> if($log =~ /IPT/){
> push(@ipts, "$log");
> }
> }
>
> ## get lines for the 31st
> foreach(@ipts){
> @good = split(" ", $_);
> if($good[1] == 31){
> push (@finale, "$_");
> }
> }
>
> ## get offending ports
> foreach(@finale){
> @broken = split(" ", $_);
> foreach $field(@broken){
> if($field =~ /DPT/){
> push(@stuff, $field);
> }
> }
> }
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]