#!/usr/local/bin/perl -w use strict; open(IN,'cisco.log') or die "$!\n"; open(OUT,'>temp.log') or die "$!\n"; while(my $line=){ if($line!~/Fan 2 not rotating/){ print OUT $line; } } system("mv temp.log cisco.log");