my $now = time; my $expire_after_seconds = $expire_after_days * 24 * 60 * 60; open DATAFILEIN, "< $catagory.dat" or die "Your listing is the first in this category!
"; flock DATAFILEIN, 2; my @temp = grep { ($now - (split /\|/)[6]) < $expire_after_seconds } ; close DATAFILEIN; unshift @temp, join( '|', $company_name, $time, $email, $member1, $member1phone, $data, $expiretime, $pictureurl, $password, $website, $member2, $member2phone, $address, $citystatezip, $fax, $catlisting )."\n"; if ( open DATAFILEOUT, "> $catagory.dat" ) { flock DATAFILEOUT, 2; print DATAFILEOUT @temp; close DATAFILEOUT; }