LOCK_FILE issue

Bryan1810
Bryan1810 used Ask the Experts™
on
Hi

I use a Perl script where you can enter your email address in a form and
your email address is then written/added to a file which then allows me to
send out newsletters etc.  However,  for some reason this script is not
working anymore. When the HTML form is submitted,  instead of adding the
email address to the flat file, the script times out and generates the
following error(s) in the web server's CGI log file:

Name "main::the_date" used only once: possible typo at subscribe.cgi line
59.
Name "main::thisdate" used only once: possible typo at subscribe.cgi line
190.
Name "main::thisip" used only once: possible typo at subscribe.cgi line 190.
Name "main::day" used only once: possible typo at subscribe.cgi line 287.
Name "main::return_to" used only once: possible typo at subscribe.cgi line
58.
Name "main::LOCK_FILE" used only once: possible typo at subscribe.cgi line
270.
Name "main::i" used only once: possible typo at subscribe.cgi line 217.
Use of uninitialized value at subscribe.cgi line 57.

I also use a Perl script where you fill in a feedback form and the when the
form is submitted,  the info is written to another HTML file.  Therefore a
guestbook facility.  However,  when I submit this form,  the script times
out and generates the following error(s) in the web server's CGI log file:

Name "main::LOCK_FILE" used only once: possible typo at feedback.cgi line
417.
Use of uninitialized value at feedback.cgi line 245.
Can't do bidirectional pipe at feedback.cgi line 245.
Use of uninitialized value at feedback.cgi line 170.

As you can see,  both scripts sort of generate the same errors and point to
LOCK_FILE.  Both these scripts were working just fine up to about 2 weeks
ago and then suddenly both stopped working.  I don't recally making any
changes to any of these scripts so I'm surprised that they just stopped
working.  It appears as if the web server is waiting for a file to either
lock or be unlocked but can't complete the action and then times out.  I
don't know.  All other Perl scripts I use work on the web server but neither
of them use LOCK_FILE...   I get the same errors now on my Windows98 PC and
at work on my Windows2000 PC.

I use Perl 5.005_03 Windows98 / IE6 and Xitami Web Server and/or Abyss Web Server X1 (both
web servers generate the same errors).  I didn't include the lengthy Perl
scripts in this post since I'm not sure whether it is allowed on the list.

Any suggestions how to solve these LOCK_FILE errors?  What is causing this?

Regards
Bryan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007

Commented:
The problem has nothing to do with file locking or errors, it is to do with warnings.

Do you have

#!/usr/local/bin/perl -w

or

use warnings;

in your scripts?

Author

Commented:
Yes I use -w in all my scripts.
Also note that these 2 scripts I'm referring to,  worked perfectly until about 2 weeks ago.  It is also the only Perl scripts on my test site that now doesn't work, and the only 2 that uses LOCK_FILE.
It does look like something related to the lock file issue.
Top Expert 2007
Commented:
Definately not a lock issue.

Not sure what has changed in your environment, but you'll either have to write your scripts so that they run cleanly with warnings on, or disable warnings.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment by Tintin

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

inq123
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial