#!/usr/bin/perl -l use strict; use warnings; use Date::Parse; my $cutoff_date = time - (45 * 86400); while (my $line = ) { chomp($line); my $date = (split /\|/, $line)[15]; my $unixdate = str2time($date) or next; print "I would ", $unixdate < $cutoff_date ? "archive" : "not archive", " $date"; } __DATA__ type|address|city|state|size|rent|term|company|contact|phone|email|website|ID|REMOTE_ADDR|HTTP_USER_AGENT|DATE|SORTORDER MFG|10 Oakmead Pkwy|San Jose|CA |10,000|$1.25|Net|Cushman Wakefield|Tom Cushman|408 555-8777|tom@cushman.com|http://www.google.com|1000000|76.102.98.35|Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)|16:01:08 2007-01-10|1003 LAND|10 Oak|San Jose|CA|14,000|$1.25|Net|Ritchie Commercial|Don Ritchie|408 555-8777|tom@cushman.com|http://www.yahoo.com|1000001|76.102.98.35|Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)|16:28:03 2008-01-10|1002 #### I would archive 16:01:08 2007-01-10 I would not archive 16:28:03 2008-01-10