Here's the code I'm using now:
------------------------------------------------------------------------------
#!/usr/bin/perl
require "cat.cgi";
$basepath = '/.../.../..../';
$scripturl = ".....";
%category = (%categoryantiques, %categoryautomotive, %categorybooks, %categorycloth, %categorycollect, %categorycomphard, %categorycompsoft, %categoryelec, %categoryentain, %categoryhouse, %categoryintell, %categoryjewel, %categorypet, %categorypot, %categorysport, %categorytool, %categorytoy, %categorytravel);
$gmoff = 3600;
$newdays = 30;
print "Content-type: text/html\n\n";
foreach $key (sort keys %category) {
opendir THEDIR, "$basepath$key" || die "Unable to open directory: $!";
@allfiles = readdir THEDIR;
closedir THEDIR;
foreach $file (sort { int($a) <=> int($b) } @allfiles) {
if (-T "$basepath$key/$file") {
open THEFILE, "$basepath$key/$file";
($title, $reserve, $inc, $desc, $image, $feat, $quantity, $shipping, $payment1, $payment2, $payment3, $payment4, $payment5, $payment6, $payment7, $payment8, $payment9, $place, $countryid, $ship, $currency, $grabber, $condition, $counter, $bold, $img, $buyit, $highlite, @bids) = <THEFILE>;
close THEFILE;
chomp($title, $reserve, $inc, $desc, $image, $feat, $quantity, $shipping, $payment1, $payment2, $payment3, $payment4, $payment5, $payment6, $payment7, $payment8, $payment9, $place, $countryid, $ship, $currency, $grabber, $condition, $counter, $bold, $img, $buyit, $highlite, @bids);
@lastbid = split(/\[\]/,$bids[$#bids]);
@firstbid = split(/\[\]/,$bids[0]);
$file =~ s/\.dat//;
@closetime = localtime($file - $gmoff);
$closetime[4]++;
$timediff = ($file - time);
$name = $title;
$name = substr $name, 0, 50;
$name .= '...';
if (time < ($newdays * 86400 + $firstbid[3])) {
print "<table cellpadding=0 cellspacing=0 border=0><tr><td valign=baseline><A HREF=$scripturl\?$key\&$file><font face=\"geneva, verdana, arial\" size=\"1\" color=black><b>$name</b></font></A> <font face=\"geneva, verdana, arial\" size=\"1\" color=black><br>currently \$$lastbid[2]</font></td></tr></table>" if ($timediff > 0);
}
}
}
}
--------------------------------------------------------------------------------
thanks
Paul