#!/usr/bin/perl # Never leave home without these! use strict; use warnings; # Loop through the faux data log, and... while () { # ...find lines that might be interesting... if (/--/) { # ... but ignore certain ones, like those # that say "logging" or "disconnected". unless ( /logging/ || /disconnected/ ) { # Print the rest. print "NOTE: $_"; } } } # Our faux data for this example __DATA__ 081407 start up server 081407 -- fatal error in procedure 1 081407 -- disconnected user 081407 -- logging started 081407 -- not enough space #### NOTE: 081407 -- fatal error in procedure 1 NOTE: 081407 -- not enough space