hello, currently we are getting EA dates set as 9-9-2005
instead of 09-09-2005...the lack of leading 0s is messing up my date comparision perl script...if anyone knows how to append a leading 0 to both the day and month i would really appreciate it, as im stumped.
thanks!
#!/u03/iw-home/iw-perl/bin/iwperl
use File::Find;
use TeamSite:

CRnode;
use TeamSite:

CRparser;
my
@list = ();
my
@matches = ();
$path = "Y:/default/main/fii/STAGING/daf/pdf/";
$EA = "Web Expiration Date";
$EA2 = "prod_delete";
$value = shift;
$counter = 0;
find(\&wanted, $path, $path2, $path3);
my
@tm = localtime();
$tm[4]++;
$tm[5] += 1900;
# gives us a YYYYMMDD format date
my $today = sprintf("%4d%02d%02d", reverse(
@tm[3..5]));
foreach $file (
@list) {
if (-d $file || $file =~ ".dtd" || $file =~ ".cfg" || $file =~ ".tpl" || $file =~ ".js" || $file =~ ".gif" || $file =~ ".jpg") {next;}
# assuming EA value is in "MM-DD-YYYY" format
# get value and change to YYYYMMDD format
chomp($dateResult = qx(iwextattr -g "$EA" "$file"));
$dateResult =~ s/^(\d{2})-(\d{2})-(\d{4})$/$3$1$2/;
$cmd2 = 'iwextattr -g "'.$EA2.'" "'.$file.'"';
$deleteResult=`$cmd2`;
my($text) = $file;
my($directory, $filename) = $text =~ m/(.*\/)(.*)$/;
#check if file is named w/ project number format
if ($filename =~ m/^[G|g]{0,1}\d{5,7}\-{0,1}\d{0,2}\.\S{0,3}/) {
print "$filename $dateResult\n";
}
}
sub wanted {-f && push(
@list, $File::Find::name);}
WoW ProfileTS 6.5 SP1
OD 6.0.2 SP1