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

To clarify what BUU said, A) You should probably communicate more with your boss. B) lib.pm is likely what you want.

Say you can upload to C:\WWW\, make a directory called lib. Under lib\, add a directory, CGI, and Session.pm inside that. Now, before your code tries to pull in CGI::Session, do a use lib 'C:\WWW\lib';.

Actually, './' is always in @INC, so you could just make the CGI directory in the same folder as your scripts (say C:\WWW\HTDOCS\), but that could get messy.

mhoward - at - hattmoward.org
  • Comment on Re^2: Porting from cgi::session to using built in activeperl management
  • Download Code

Replies are listed 'Best First'.
Re^3: Porting from cgi::session to using built in activeperl management
by shaolindoman (Acolyte) on Jul 12, 2004 at 20:05 UTC
    Ok, I will try that. I also found some help at  http://www.rcbowen.com/imho/perl/modules.html if anyone else may ever need it. Thanks!
Re^3: Porting from cgi::session to using built in activeperl management
by shaolindoman (Acolyte) on Jul 12, 2004 at 21:17 UTC
    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

      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
      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.