in reply to Skip a line

I'm guessing that you're wanting to have a single line at the top of the file that doesn't change with the rest of them. Some kind of header line, perhaps. In this case, just calling     <DATAFILEIN>; to read in and discard the first line, as others have suggested, would work.

By the way, I'd write your code (above) as follows:

my $now = time; my $expire_after_seconds = $expire_after_days * 24 * 60 * 60; open DATAFILEIN, "< $catagory.dat" or die "Your listing is the fir +st in this category!<br>"; flock DATAFILEIN, 2; my @temp = grep { ($now - (split /\|/)[6]) < $expire_after_seconds + } <DATAFILEIN>; 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; }
One thing needs to be stressed: you must explicitly close the file when you're done reading or writing it. Just releasing the lock (calling  flock 8) is not enough. In fact, closing the file also releases the lock, so you don't need to call  flock 8 at all, normally.

A couple other comments:

1. You probably will find it more convenient, in the long term, to use a hash variable, rather than that long slew of separate variables. I.e. instead of   print DATAFILEOUT "$company_name|$time|$email|$member1|$member1phone|$data|$expiretime|$pictureurl|$password|$website|$member2|$member2phone|$address|$citystatezip|$fax|$catlisting\n"; you could have

print DATAFILEOUT join( '|', @userinfo{qw( company_name time email member1 member1phone data expiretime pictureurl password website member2 member2phone address citystatezip fax catlisting )}, "\n";
for example.

2. Your emailme() subroutine should probably take arguments, rather than using global variables ($toemail, $fromemail). Then you could it as

$emailme eq 'yes' and emailme( $myemail, $userinfo{'email'} ); $emailuser eq 'yes' and emailme( $userinfo{'email'}, $myemail );
Hope this helps,

jdporter
...porque es dificil estar guapo y blanco.