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

Hi

I've installed CGI::Session and ActiveState's ActivePerl on a Windows 2000 Server machine using PPM, but I can't get it to work in my script.

First I tried using the File driver, but was told ActivePerl couldn't locate CGI/Session/File.pm in @INC. I downloaded this myself from CPAN and put in an appropriate directory. Then I tried again, but got Base class package CGI::Session::ID::MD5 is empty. I then tried using other drivers, but kept getting this second message.

I've only just installed the package and the script is lifted straight out of one of the CGI::Session files. Anyone any ideas what's going on?

Thanks,
A

Replies are listed 'Best First'.
Re: CGI::Session and ActivePerl problem
by tcf22 (Priest) on Aug 28, 2003 at 16:17 UTC
    Looks like your sample script is using
    new CGI::Session("driver:File", undef,{Directory=>'/tmp'});
    CGI::Session::File is the default Session Driver.

    Try getting a copy of File.pm and dropping it in @INC

    Update: You need to install
    • CGI::Session::ID::MD5
    • CGI::Session::Serialize::Default
    my ppm didn't work for either of them, so you'll need to pull the source off of CPAN and install it manually.
      Hi,

      I tried installing CGI::Session::File using PPM, but it couldn't locate a PPD for it, so I just downloaded CGI::Session::File.pm from CPAN myself and saved it in a Perl\site\lib\cgi\session along with the other drivers - but as I mentioned, while this solved the original problem, it's now left me with the second error message above.

      Any ideas?

      A
        Let's see.... Readme for CGI::Session says
          ID GENERATORS
            Following ID generators are available:
            *   MD5 - generates 32 character long hexidecimal string. Requires
                Digest::MD5. Full name: CGI::Session::ID::MD5.
        
        Do you have Digest::MD5 installed?   Using PPM I see
        PPM> search md5
        Packages available from http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMS
        erver:
        Digest-MD5    2.27 Perl interface to the MD5 Algorithm
        Packages available from http://ppm.ActiveState.com/cgibin/PPM/ppmserver.pl?urn:/PPMServer:
        Digest-Perl-MD5 1.5 Perl Implementation of Rivest's MD5 algorithm
        
        Note that Digest-MD5 is available from a different site than ActiveState.   Depending on the ActivePerl version you have you would set PPM to use one of Randy Kobe's two PPM-package directories.   I use the 6xx one, which you can add to PPM using:
        set repository RK http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver +?urn:/PPMServer

        But I am very much worried that CGI::Session was not installed correctly to begin with.   CGI:Session::File is _part_ of that package.   If parts of the package were not installed in the right places who knows what else might be wrong.   I think you should go back and figure out what the _first_ problem was...

Re: CGI::Session and ActivePerl problem
by PodMaster (Abbot) on Aug 29, 2003 at 07:36 UTC
    I downloaded this myself from CPAN and put in an appropriate directory
    That's likely the root of all your problems. That is not the way to install modules. Things can go wrong at every step of the install process.

    Kindly read Tutorials -> A Guide to Installing Modules and perldoc perlmodinstall, then download the CGI-Session distribution from cpan, and follow what you learned in the Tutorials.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Thanks for all your help guys.

      The CGI::Session module was installed directly using PPM and didn't throw any error messages during installation. I tried downloading File.pm myself, which solved the original problem as I explained. I then tried removing it and reinstalling CGI::Session again, but to no avail.

      While CGI::Session::File.pm is part of the CGI::Session module, it's not installed by PPM. It's not the problem, however - as the other drivers all fail with the same error message. I tried installing from CPAN, using nmake, but while this installed File.pm, it didn't sort out the problem.

      However I have solved the problem - I simply downloaded the following files from CPAN : CGI::Session::File.pm, CGI::Session::ID::MD5.pm and CGI::Session::Serialize::Default.pm and installed them in appropriate directories. I then added the following lines to CGI::Session::File.pm : use CGI::Session::ID::MD5 and use CGI::Session::Serialize::Default before the line use base qw(.

      My script seems to compile now. I'll test it out and make sure it works OK though.

      Thanks,
      A
Re: CGI::Session and ActivePerl problem
by jdtoronto (Prior) on Aug 28, 2003 at 16:34 UTC
    Hi,

    I had the same problems and gave up on it eventually, check the status of the module at Active State, they will tell you if it compiles without error, generally if it copmpiles without error they package it up and make a ppd available for it.

    I also tried using the MySQL driver, similar problems.

    jdtoronto