use strict; use Net::SMTP; print"monitoring snort log \n"; print " hit q then enter to exit: "; open (fh, "< e:\\snort\\log\\alert.ids") or die "Can't open File"; my @lines = ; my $hours = 0; while ( != 'q') { while ($hours < 72) { # hours of updates you want my $timer = 0; while ($timer < 1) { # minutes between the update #Mail Data my $smtp = Net::SMTP -> new('mailserver.mail.com'); #Connect to a mail server $smtp -> mail( 'sending\@mail.com'); #Sender's name $smtp -> to('receiving\@mail.com'); #Receivers name $smtp -> data(); # Send the header $smtp -> datasend("To: 'receiving\@mail.com\n"); $smtp -> datasend("From: sending\@mail..com\n"); # Send the Body my $x = 0; while ($x < 25 ) { #lines to print my $lines = pop @lines; $x++; print $lines."\n"; $smtp -> datasend($lines); } $smtp -> dataend(); $smtp -> quit; $timer++; $hours++; sleep 3600; } } } close (fh);