Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

CPAN/MD5 Problem

by adam525 (Initiate)
on Jul 26, 2002 at 15:42 UTC ( #185571=perlquestion: print w/replies, xml ) Need Help??
adam525 has asked for the wisdom of the Perl Monks concerning the following question:

I have several apps that use MD5. They all give me the same error which is Can't locate object method "new" via package "MD5" (perhaps you forgot to load "MD5"?) when I try to run them. If I try to reinstall MD5 with CPAN I get the same error. Any ideas?

Replies are listed 'Best First'.
Re: CPAN/MD5 Problem
by ichimunki (Priest) on Jul 26, 2002 at 15:51 UTC
    This could be caused by competing installs of perl on the same machine, although you'd think that would fall over on your "use Digest::MD5" statement.

    First thing to check is perl -V and @INC to ensure that the perl you think you're using and the perl your scripts think they're using match-- more to the point: that they have the same lib(rary) tree. If the scripts have #!/usr/bin/local/perl and your path (which would affect perl -V and perl -MCPAN -e "shell") has /usr/bin before /usr/local/bin, you might be installing CPAN modules into a different lib tree than the script's perl is checking for.

Re: CPAN/MD5 Problem
by Rex(Wrecks) (Curate) on Jul 26, 2002 at 17:03 UTC
    The newer Digest::MD5 also tries to use Digest::Perl::MD5, you might want to make sure that that module is installed as well. If it is not, it may very well be warning you about the second MD5 package :)

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
Re: CPAN/MD5 Problem
by dws (Chancellor) on Jul 26, 2002 at 16:54 UTC
    I have several apps that use MD5. They all give me the same error which is Can't locate object method "new" via package "MD5"

    Post a small fragement of code that demonstrates the problem. You should be able to do it in 3 lines. This'll rule out simple coding errors.

Re: CPAN/MD5 Problem
by mitd (Curate) on Jul 28, 2002 at 19:10 UTC
    Quote from module readme:
    This module ( is just a thin wrapper around the Digest::MD5 module. It is provided so that legacy code that rely on the old interface continue to work with the speed benefit of the new module.

    Bottom line Digest::MD5 is now required by if you wish, as you seem to suggest in your question, to use the older (deprecated)

    As suggested in prior art abandoning and going straight to Digest::MD5 is highy recommended.

    mitd-Made in the Dark
    'Interactive! Paper tape is interactive!
    If you don't believe me I can show you my paper cut scars!'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://185571]
Approved by TStanley
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2018-04-20 05:35 GMT
Find Nodes?
    Voting Booth?