in reply to Re: My first Perl script
in thread My first Perl script

Ahh, I was able to modify my code with you what suggested. Here is the new code:

#!/usr/bin/perl #Variables $firewall_log = "/home/jwilliams/firewall.txt"; $my_new_log = "/home/jwilliams/extracted_log"; open(FW_LOG, $firewall_log) or die "$firewall_log open() failed: $!"; open(MYNEWFILE, ">>$my_new_log:") or die "$my_new_log open() failed: $!"; while ($line = <FW_LOG>) { if ($line =~ /kernel Temporarily blocking host/ || $line =~ /block +ed/) { # your line transformations would go here... print MYNEWFILE $line; } } close(FW_LOG); close(MYNEWFILE);
Now, I just need to figure out how to clean up the extracted info.

T.