I'm comparing an array of email addresses with another array of emails with appended dates. I want to remove the dates, reformat them, sort them most recent first.
The script worked but ended before it worked through the entire array. I thought it timed out for some reason and fed the script a shorter array.Again it worked before completing the array. Again I shortened it and then it failed to work at all displaying the error: Error parsing time at /usr/lib64/perl5/Time/Piece.pm line 469.
#!/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=<CSV>; close (CSV); open (BUYERS,"<../../public_html/buyers.txt"); @buyers=<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); }
I can't determine what is generating the error. Thanks in advance.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |