I've copied example 4-15 and multi-checked it, for the
past couple of days. Finally used a copy of the example
obtained from the book site. But still have problems.
[note: the example from the book sight used strftime(time, '%D')
in sub write_guestbook. Changing that to strftime('%D', localtime)
helped]
Using apache 1.3.9 and mod_perl 1.21.
With 'use strict' there is this error:
Can't use string ("1") as a symbol ref while "strict refs" in use
at .....
That's a 1 (one) used by 'sub lock()', given as the second arg
as a flag to turn on an exclusive lock on the file.
There are other warnings, and another error when I comment out
'use strict' - like:
Can't call method "close" without a package or object reference at ...
But any help on that first error would be appreciated.
I've tried this script in the cgi-bin dir and a perl/ dir I've used
to run all the other example .pl scripts. In each dir the .htaccess
file given in the book was used. Permissions checked. But just to make
sure, a PerlSetVar GuestbookFile /usr/local/apache/projects/guests.txt
was added to the appropriate directives in httpd.conf for the
the cgi-bin directory, and in the perl.conf for the perl dir.
in httpd.conf
<Directory "/usr/local/apache/cgi-bin">
AllowOverride All # added this
Options None
Order allow,deny
Allow from all
PerlSetVar GuestbookFile /usr/local/apache/projects/guests.txt # added
this
</Directory>
in perl.conf
Alias /perl/ /usr/local/apache/perl/
<Location /perl>
AllowOverride All
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
PerlSetVar GuestbookFile /usr/local/apache/projects/guests.txt
</Location>
Or where and how should I be trying to run this script?
Appreciate any help.
Thanks,
M. Dearman