The lock() function is for use in threaded applications. It does not lock files.
The discussion that was linked to describes a bunch of CGI scripts, which typically aren't multi-threaded, so I would assume that what's intended is a file lock, to prevent inter-process conflicts, rather than a variable lock, to prevent inter-thread conflicts within a single process.
See the flock function instead.
Update: I've downloaded and looked around the code from the webapp site linked to above, and found that it does define a lock() function that in turns calls the built-in flock().
Perhaps the problem is that for some reason the cgi-lib/forum.pl file is being loaded before cgi-lib/subs.pl?
As a longer-term solution, you might find that renaming the lock function in subs.pl to lock_file, and similarly changing all of the calls to match, might be sufficient to fix it.
In reply to Re: Has the "require" functionality changed in Perl 5.8.1?
by simonm
in thread Has the "require" functionality changed in Perl 5.8.1?
by Alatar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |