sub date_manip { my ($month, $day, $year) = (localtime)[4,3,5]; sprintf ("%02d/%02d/%02d\n", $month+1,$day,($year % 100)); } my $dm = '&date_manip'; sub date_manip1 { my $days = (shift); my ($d, $m, $y) = (localtime($time - $days * 86400)) [3..5]; sprintf ("%02d/%02d/%02d", $m+1,$d,($y % 100)); } my $dmm = '&date_manip1(1)'; #print ("$dm $dmm"); ############################################################ ## Gather data for scratch tapes; open file, create list, then print it. ## ############################################################ open (FOO, ">$scratches") || die "could not open file:$!"; #($^I, @ARGV) = ('.bak', $scratches); open (D, "$logf") || die "could not open file:$!"; while () { ## look for 9840S and ebexpire ## declare OFS = tab ## tell split to split on IRS 0,1&5. # if (($_ =~ /9840S/) && ($_ =~ /ebexpire, ebexpire/ )) { if (($_ =~ /9840S/) && ($_ =~ /ebexpire, ebexpire/ ) && ( $_ =~ m/$dm/) && ($_ =~ m/$dmm/)) { local $, = "\t"; print FOO +(split)[0,1,5], $/ ; } } close (FOO); close (D);