Compare Date with PERL

(This is one of my English Diary, just for exercise.)
I haven’t touch PERL for a long time, feel so tired to debug script error on page with “Internal Server Error”, that’s the reason I don’t like it. But the reason I still use it is because CPAN, it’s a huge library for PERL Archive. You can easily find any function you can imagine. Here’s a example to Compare Date.
[code lang=”per”]

print “Content-type: text/htmlnn”;

you need three packages: Date::Parse, Time::Local, Time::Zone;

use Date::Parse;
my $secs = str2time(“2008-02-14”);
my $now=time();

check we got something useful back

unless (defined $secs){
die “Can’t parse ‘$time’ as a time or daten”;
print “End as:n”, “‘$secs’ (“.gmtime($secs).”)
print “Now as:n”, “‘$now’ (“.gmtime($now).”)
if($now >= $secs){
print “It’s time to go now.”;
print “Don’t worry, still have time.”;