c has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Fcntl ':flock'; sub add { open FH, ">>$file" or die "Cant open config file $!\n"; lock(); print FH "zone \"$formdata{domain}\" in \{\n\ttype slave\;\n\tfile\" +$client\/db.$formdata{domain}\"\;\n\tallow-query \{ any\; \}\; \}\;\n +\n"; unlock(); close FH; } sub lock { flock(FH,LOCK_EX); } sub unlock { flock(FH,LOCK_UN); }
I've read over flock and I seem to be using the exact syntax as in the description page, however when ran, my script returns:
Not enough arguments for lock at ./dnsmod.cgi line 232, near "lock()"
From the snippet above, line 232 is simply:
lock();
What additional arguments is it looking for?
humbly -c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: error stating flock requires more args
by tachyon (Chancellor) on Jul 31, 2001 at 19:30 UTC | |
|
Re: error stating flock requires more args
by Hofmator (Curate) on Jul 31, 2001 at 18:35 UTC | |
|
Re: error stating flock requires more args
by converter (Priest) on Jul 31, 2001 at 18:49 UTC | |
|
(tye)Re: error stating flock requires more args
by tye (Sage) on Jul 31, 2001 at 19:36 UTC | |
|
Re: error stating flock requires more args
by physi (Friar) on Jul 31, 2001 at 18:24 UTC |