#!/usr/bin/perl use strict; use warnings; use Time::Local; #use Time::gmtime; my $inputfile = "/home/vdelaney/test.txt"; my $inputmodfile = "/home/vdelaney/test_mod.txt"; my $outputfile = "/home/vdelaney/test_out.txt"; system("cat \"$inputfile\" | awk '{print \$2}'| awk -F 'T' '{print \$1}' > $inputmodfile"); my $seventh_days= 7 * 24 * 60 * 60; print " seventh_day from today=$seventh_days\n"; my ($old_day, $old_month, $old_year) = (localtime(time - $seventh_days))[3..5]; #print "old_day=$old_day ,old_month= $old_month,old_year= $old_year \n"; my $cutoff = sprintf('%04d-%02d-%02d', $old_year + 1900, $old_month + 1, $old_day); print "cutoff date=$cutoff\n"; open my $handle, '<', $inputmodfile; chomp(my @lines = <$handle>); close $handle; #print "List of lines that have dates older than the cutoff date\n"; my ($yyyy, $mm, $dd); my $epoch_seconds; my $strings; for my $date (@lines) {