#!/usr/bin/perl -wt use strict; use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); use Time::Piece; print "Content-type: text/html\n\n"; my (@buyers,@csv,@dif,@end,@sort,@time,@zed,$demo,$first,$second); open (CSV,"<../../public_html/emails.txt"); @csv=; close (CSV); open (BUYERS,"<../../public_html/buyers.txt"); @buyers=; close (BUYERS); foreach $first(@csv) { chomp($first); push(@zed,$first); foreach $_(@buyers) { if($_=~/$first/) { $_=~/\d+\/\d+\/\d+/; my $date=Time::Piece->strptime($&, '%m/%d/%Y'); my $newdate=$date->strftime('%Y%m%d'); push(@time, $newdate); } } @time = sort {$b <=> $a} @time; foreach (@time) { push(@zed,$_ ); } undef(@time); }