Try this Subroutine if you'd like. It's something I use currently to check for files of a certain age (less than 1 day old) and create an HTML page from these files. I'm sure it's not the cleanest code, but it works for my purposes.
[tt]sub g
{
foreach (glob "$_[0]/*"
{
# recurse into subdirectories
-d && g($_) unless -l;
# if file ending in desired extension
if (-f && /\.pdf$/i)
{
# check file for age. If less than 1 day old,
# create HTML page of directory.
if ((-M) < 1.02)
{
my $file = $_;
writehtml("$file","$topdir" # start HTML creation subroutine
return;
}
}
}
}
[/tt]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.