R
Robert
Hi,
I am getting the following error when trying to print to a file and locking.
Browser Error:
------------------
Bareword "LOCK_EX" not allowed while "strict subs" in use at record.pl line
208.
Execution of record.pl aborted due to compilation errors.
------------------
Here is my write-to-file code:
------------------
sub record {
my $nowtime = time();
my $newentry = "$nowtime|$invoice|$fullname|$company|$emailaddy|$phone";
open (LOCKER, "<lockfile.db") or die "Can't open file: $!";
flock (LOCKER, LOCK_EX) or die "Can't lock file: $!";
open (FH, ">>records.db") or die "Can't open file: $!";
print FH "$newentry\n";
close(FH);
close(LOCKER);
}
------------------
I always use "use strict;" in my programs and have never seen this error
before. I'm not sure where to start in researching a solution. Please if you
have any thoughts please and thank you.
Robert
I am getting the following error when trying to print to a file and locking.
Browser Error:
------------------
Bareword "LOCK_EX" not allowed while "strict subs" in use at record.pl line
208.
Execution of record.pl aborted due to compilation errors.
------------------
Here is my write-to-file code:
------------------
sub record {
my $nowtime = time();
my $newentry = "$nowtime|$invoice|$fullname|$company|$emailaddy|$phone";
open (LOCKER, "<lockfile.db") or die "Can't open file: $!";
flock (LOCKER, LOCK_EX) or die "Can't lock file: $!";
open (FH, ">>records.db") or die "Can't open file: $!";
print FH "$newentry\n";
close(FH);
close(LOCKER);
}
------------------
I always use "use strict;" in my programs and have never seen this error
before. I'm not sure where to start in researching a solution. Please if you
have any thoughts please and thank you.
Robert