Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

blowfish module problem

by rimmern (Acolyte)
on May 31, 2002 at 06:17 UTC ( [id://170636]=perlquestion: print w/replies, xml ) Need Help??

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

Hi
I am trying to use the crypt blowfish module. I downloaded it (to c:\perl\lib\crypt\blowfish) and installed it OK (on a Win98 machine)

. However, when I try to use the module using any of the following methods I get error messages.

1. #!/usr/bin/perl -w -I/usr/lib/crypt/blowfish
2. use lib ("Blowfish", "c:\PERL\lib\crypt\blowfish");
3. use lib ("c:\PERL\lib\crypt\blowfish\blowfish.pl");
4. BEGIN { push @INC, "/usr/lib/crypt/blowfish" || die("Can't import blowfish module into INC listing!\n"); }

(and 4. doesnt produce an error message). The errors I do get are like:

C:\perl\bin>perl blowfish.pl
Can't locate Blowfish/Blowfish.pm in @INC (@INC contains: c:\PERL\lib\crypt\blow fish\blowfish.pl C:\PERL\lib\site C:\PERL\lib c:\perl\lib c:\perl\lib\site c:\pe rl\lib\site .) at blowfish.pl line 18.
BEGIN failed--compilation aborted at blowfish.pl line 18.

Does anyone have any ideas ?

Replies are listed 'Best First'.
Re: blowfish module problem
by DamnDirtyApe (Curate) on May 31, 2002 at 06:40 UTC
    Give this a try (although I suspect the first line is not needed):
    use lib 'C:\PERL\LIB' ; use Crypt::Blowfish ;
    By saying use Crypt::Blowfish, you are telling perl to look for a Blowfish.pm module in a crypt/ subdirectory below any directories in @INC.
    _______________
    D a m n D i r t y A p e
    Home Node | Email
      Sorry - I forgot to say that I had already tried 'use Crypt::Blowfish ;' but with no luck :-(
        Have you tried installing it using ppm?
        ppm install Crypt::Blowfish

        -dwiz
Re: blowfish module problem
by moodster (Hermit) on May 31, 2002 at 11:30 UTC
    How did you install the module? Judging by the first paragraph I assume that you downloaded it by hand and then unzipped it into c:\perl\lib\crypt\blowfish. That might work with some modules, but many require extra setup and initialization on installation. The easy way of doing that it to use ppm3 (assuming you are using ActiveState Perl):
    ppm3 install Crypt-Blowfish
    automagically downloads and installs the Crypt::Blowfish module (at least on my system). You should then be able to just put use Crypt::Blowfish in you script and it should work straight away.

    Apologies if you've already installed and set up the module properly; I don't mean to sound rude or anything.

    Cheers,
    --Moodster

Re: blowfish module problem
by Steve_p (Priest) on May 31, 2002 at 12:34 UTC
    Your use lib statement is incorrect. You only need to point to the top level of your library. So try
    use lib "c:\PERL\lib";
    Perl uses the package name to find the location of the module. So, since you said the lib is c:\PERL\lib\crypt\blow fish\blowfish.pl, Perl is looking in c:\PERL\lib\crypt\blow fish\blowfish.pl\Crypt\Blowfish for the file Blowfish.pm. My question is did you download the module and add it correctly? If you used ppm, then the module should be in c:\perl\site\lib\. If you didn't use ppm, I would suggest trying that first next time. If you didn't use ppm, did you use nmake to build this module? It also would put the module in c:\perl\site\lib\. If you didn't use either, you better read the ReadMe again.
Re: blowfish module problem
by alien_life_form (Pilgrim) on May 31, 2002 at 12:59 UTC
    Greetings,

    use lib ("Blowfish", "c:\PERL\lib\crypt\blowfish");
    Are those really double quotes? because if they are, then all your backslashes are escaping the following chars... I would give single quotes a chance.
    Cheers,
    alf
    You can't have everything: where would you put it?
Re: blowfish module problem
by oakbox (Chaplain) on May 31, 2002 at 21:13 UTC
    The FIRST thing you should do is make sure that your Perl is installed in the default location. Because you may have done something funky and installed it in C:\perlhome\... You have to work to put it someplace non-standard, but that doesn't mean it didn't happen.

    Run: perl -V from the command line and Perl will tell you all about itself, including where it is looking for libraries. THEN go back and reread all of the above posts on how to include paths in @INC :)


    -oakbox

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://170636]
Approved by virtualsue
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-29 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found