in reply to Re^2: Porting from cgi::session to using built in activeperl management
in thread Porting from cgi::session to using built in activeperl management

I'm still getting an error and I'm a little confused. Please tell me if I'm doing this correct. I used the link to go to cpan.org and I clicked on the Source link, copied, and saved it to a file as  lib.pm. I then uploaded it to the top of the directory in the server. I then created a sub-dir from the top-level-dir called lib and a sub-dir in this called CGI where I put the source file Session.pm. I then tried to access the script I was using it for and got a server error. I included the file as
use lib '\lib';
Then I tried  use lib '/lib' and use lib 'lib'; I'm not sure what I'm doing wrong here or missing and I know the script works b/c when I take out the use lib... part it runs fine. Please help. Thanks

Replies are listed 'Best First'.
Re^4: Porting from cgi::session to using built in activeperl management
by meredith (Friar) on Jul 12, 2004 at 21:25 UTC

    Eeek! lib.pm is a core module, you should already have it. I'm not entirely clear about the layout you've created, but I think it's a matter of relative paths. Try using an absolute path to the lib directory.

    Maybe referring you to this will help. You can look at my scripts, the layout, and the INSTALL file to see what I've done.

    mhoward - at - hattmoward.org
Re^4: Porting from cgi::session to using built in activeperl management
by jplindstrom (Monsignor) on Jul 13, 2004 at 02:13 UTC
    Remove the lib.pm file you put there, it doesn't do what you think.

    Keep the "use lib" line. It tells perl where it can find modules. So after that line in the script, perl looks under C:/lib/, and if it looks for CGI::Session, it will look for the file C:/lib/CGI/Session.pm

    CGI::Session uses a few more internal classes besides the CGI/Session.pm file. I suggest you download the entire module from CPAN. When you unzip the file you'll find the Session directory somewhere. That directory and it's contents (including subdirs) is what you should upload to the "/lib/CGI" directory in your example.

    Hope That Helps,

    /J

      That still didn't work. I'm still getting an error stating: specified CGI application misbehaved by not returning a complete set of HTTP headers which could be anything really because the script runs fine without the use CGI::Session in there. At least it did work with use lib. I'm not sure what else to do at this point. This site is supposed to go live on the 18th of this month. Anyone have any suggestions for a windows host with MS Access that will let me use third party libraries? At least the host I'm with does have a 30-day money back policy.
        This is just off the top of my head. It should get you going in the right direction:

        You need to see the error message. It's probably in the web server's error log. Ask the web host for instructions, or read their help pages.

        If you can't view it, you need to force it onto the web page (instead of the generic error you get).

        Put a

        use CGI::Carp qw(fatalsToBrowser);

        near the top of the script (before the CGI::Session stuff).

        If you still get the generic error, there might be a syntax error in your script somewhere else. Run it on a command line.

        /J