rctay has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Apache 2.052 Win32, mod_perl 1.99_17, Perl 5.84, installed on a fat32 drive, f.

this is the code:

#!F:/Net/Perl/bin/Perl.exe use strict; use Digest::MD2; print "Content-type: text/plain\n\n"; my $ctx = Digest::MD2->new; my $data = "foo"; $ctx->add($data); my $digest = $ctx->digest;

this is the error(s):
--
#1st run
error Can't locate object method "bootstrap" via package "Digest::MD2" at F:/Net/Perl/site/lib/Digest/MD2.pm line 14.\nCompilation failed in require at (eval 7) line 6.\nBEGIN failed--compilation aborted at (eval 7) line 6.\n

#2nd/subsequent runs
error Can't locate object method "new" via package "Digest::MD2" at (eval 8) line 10.\n
--

the problem is that it works in cgi-bin, but fails in the mod_perl directory.

any suggestions is highly appreciated.

  • Comment on [error] Can't locate object method "new" via package "Digest::MD2"
  • Download Code

Replies are listed 'Best First'.
Re: [error] Can't locate object method "new" via package "Digest::MD2"
by fglock (Vicar) on Nov 30, 2004 at 11:22 UTC

    Digest::MD2 is partly written in C, and it must be compiled (maybe it wasn't) and it must have access to it's libraries. How did you install it?

      I can't explain why it works in one place and not the other, but:

      http://www.gossamer-threads.com/lists/modperl/modperl/75167
      (assuming that's also you ;)

      ...might suggest something not quite right with the mod_perl part of the configuration. And, the DBI error might be helpful to the monks in taking a stab at the root of the problem. fat32 should be no issue, either, particularly since there are no ACLs with which to contend. Maybe there's something flaky with regards to the user under which Apache is running? Is there only one version of Apache on board? (I am noting from the other comment that there's only one install of perl).

Re: [error] Can't locate object method "new" via package "Digest::MD2"
by elwarren (Priest) on Nov 30, 2004 at 16:59 UTC
    did you setup a proper PERL5LIB and possibly use Digest::MD2; in your mod_perl startup script? I believe this changed with Apache2, how did you setup your environment?

      fglock:
      Digest::MD2 came with the ActiveState Perl installation.

      BraveTwoZero:
      There's only one Apache installation.

      elwarren:
      Here's part of httpd.conf related to mod_perl:

      #mod_perl LoadFile "F:/Net/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so PerlRequire "F:/Net/Apache Group/Apache2/conf/startup.pl" Alias /perl/ "F:/Net/Apache Group/Apache2/perl/" <Location /perl> SetHandler perl-script PerlResponseHandler ModPerl::Registry Options +ExecCGI PerlOptions +ParseHeaders PerlSendHeader On </Location> <Location /cgi-bin> SetHandler cgi-script Options +ExecCGI </Location> <Location /perl-status> SetHandler modperl PerlResponseHandler Apache::Status Order Deny,Allow Allow from all </Location>

      The thing to note is that it works with cgi-bin, and not in the /perl directory.