From: jain () mail ! physics ! smu ! edu (Rakesh Jain)
To: tru64-unix-managers
Subject: help with perl.
Date: Tue, 20 Jan 1998 18:59:54 +0000 [thread overview]
Message-ID: <96078654410928.tru64-unix-managers.marc@archive.invalid> (raw)
hi there,
I am trying to do a date match in perl and it does not seem to work.
here is my test program and output.
-------------------------------------
#!/usr/local/gnu/bin/perl
$month = 0;
local ($sec, $min, $hour, $day, $month, $year, $wday, $yday, $isdst)
= localtime();
++$month;
if ($month <= 9) {
$month = "0$month";
}
if ($day <= 9) {
$day = "0$day";
}
$d_ad_updated = "121297";
$s_ad_updated = "$month$day$year";
print "s_ad_updated = $s_ad_updated\n";
if ($s_ad_updated < $d_ad_updated)
{
print "$s_ad_updated is less than $d_ad_updated\n";
}
system ("date");
exit(0);
------------------------------------------------------------
and output is:
s_ad_updated = 012098
012098 is less than 121297
Tue Jan 20 12:56:42 CST 1998
Here we can see the comparison does not work. Any pointers to solve
this problem will be greatly appreciated.
Thanks
Rakesh
next reply other threads:[~1998-01-20 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-01-20 18:59 jain [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-10-24 6:07 help with perl jain
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox