#!/usr/bin/perl use strict; use Date::Manip; my $limit = DateCalc( 'now', '- 45 days' ); while () { my $datestr = (split / : /)[0]; # note spaces around ":" print if ( ParseDate( $datestr ) > $limit ); } __DATA__ Fri Dec 3 23:07:21 EST 2004 : Depth is : 234 Sat Dec 4 00:07:29 EST 2004 : Depth is : 123 Sat Feb 26 14:13:12 EST 2005 : Depth is : 4567