David Arnold wrote:
Stas,


package Apache::AuthAnon;
# file: Apache/AuthAnon.pm

use strict;
use Apache::Constants qw(:common);

my $email_pat='[EMAIL PROTECTED]';
my $anon_id="anonymous";

sub handler {
   my $r=shift;

   my($res,$sent_pwd)=$r->get_basic_auth_pw;
   return $res if $res!=OK;

   my $user=lc $r->connection->user;
   my $reason="";

   my $check_id=$r->dir_config("Anonymous") || $anon_id;

   $reason="user did not enter a valid anonymous username: "


Because you didn't load the right modules. Try again with:

perl -wc -MApache2 -MApache::compat AuthAny.pm

in general it's not possible to test code relying on mod_perl run time from the command line.


I got this:

[EMAIL PROTECTED] Apache]$perl -wc -MApache2 -MApache::compat AuthAny.pm
Bareword "Apache::server_root" not allowed while "strict subs" in use at
/usr/lib/perl5/site_perl/5.8.4/i686-linux-thread-multi/Apache2/Apache/compat
.pm line 255.
Compilation failed in require.
BEGIN failed--compilation aborted.

Is this right?

Yes, David, this is right for the majority of the API.

Again, do not test your modperl code w/o running modperl, which you accomplish with help of Apache-Test.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to