lisaw has asked for the wisdom of the Perl Monks concerning the following question:
my @temp; open(DATAFILEIN, "$catagory.dat") || print "Your listing is the fi +rst in this category!<br>"; flock (DATAFILEIN, 2); while(<DATAFILEIN>) { @line_pair = split(/\|/,$_); $time2 = $line_pair[6]; $currenttime = time (); $difference = $currenttime - $time2; #computing the number of seconds before it expires $expires = $expire_after_days * 86400; if($difference < $expires){ push (@temp,$_); } } flock (DATAFILEIN, 8); if (open(DATAFILEOUT, ">$catagory.dat") ) { flock (DATAFILEOUT, 2); print DATAFILEOUT "$company_name|$time|$email|$member1|$member +1phone|$data|$expiretime|$pictureurl|$password|$website|$member2|$mem +ber2phone|$address|$citystatezip|$fax|$catlisting\n"; print DATAFILEOUT @temp; userlog(); if ($emailme eq "yes") { $toemail = $myemail; $fromemail = $email; emailme(); } if ($emailuser eq "yes") { $toemail = $email; $fromemail = $myemail; emailme(); } flock (DATAFILEOUT, 8);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Skip a line
by kabel (Chaplain) on Nov 11, 2002 at 18:29 UTC | |
|
Re: Skip a line
by jdporter (Paladin) on Nov 11, 2002 at 22:14 UTC | |
|
Re: Skip a line
by FamousLongAgo (Friar) on Nov 11, 2002 at 18:36 UTC | |
|
Re: Skip a line
by Enlil (Parson) on Nov 11, 2002 at 18:36 UTC | |
by sauoq (Abbot) on Nov 11, 2002 at 20:42 UTC | |
|
Re: Skip a line
by tachyon (Chancellor) on Nov 11, 2002 at 18:36 UTC | |
by lisaw (Beadle) on Nov 11, 2002 at 19:02 UTC | |
by tachyon (Chancellor) on Nov 11, 2002 at 19:29 UTC |