Subversion Repositories sysadmin_scripts

Rev

Blame | Last modification | View Log | Download | RSS feed

#! /usr/bin/perl -w

use Date::Parse;
use POSIX 'strftime';

# Separate colon delimited lines

while ($line = <>) {
   chomp $line; 
   ($filename, $constant, @date) = split (':', $line); 
   # @date is an array containing parts of the date/time
   # join them all together with colons, then use strptime
   # to turn them into a true date object (array, see localtime).
   # once that is done, we can pass it to strftime for pretty
   # formatting
   @date = strptime( join (':',@date) );
   $date = strftime '%F', @date;
   $filename =~ s/\.whois//;
   $filename =~ s/^.*cache\///;
   $date =~ s/^\s+//;
   print "$date\t$filename\n";
}
1;