Hello all..im trying to write a perl script that will check if an extended attribute on our DCRs called "Web Expiration Date" (format MM-DD-YYYY) is less than or equal to todays date. the below code isnt working for me:
$EA = "Web Expiration Date";
($day, $month, $year) = (localtime)[3..5];
$year = $year + 1900; #got 2004
$month = $month + 1;
if ( $day <= 9 ) {
$day = "0".$day;
}
if ( $month <= 9) {
$month = "0".$month;
}
$today = $month.-$day.-$year;
foreach $file (
@list) {
$cmd = 'iwextattr -g "'.$EA.'" "'.$file.'"';
$cmd2 = 'iwextattr -g "'.$EA2.'" "'.$file.'"';
$result=`$cmd`;
$result2=`$cmd2`;
my($text) = $file;
my($directory, $filename) = $text =~ m/(.*\/)(.*)$/;
if (($result <= $today) and ($result ne "")) {
etc etc
is that not a valid comparison with the dates in the MM-DD-YYYY format? thanks in advance
-------------------
World of Warcraft — Illidan/Horde