Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

CGI::Session isn't installed?

by mwhiting (Beadle)
on May 16, 2007 at 16:29 UTC ( [id://615828]=perlquestion: print w/replies, xml ) Need Help??

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

Hi Monks. I'm trying to use CGI::Session to use session variables for the first time. I can put the 'use CGI' instruction into my .cgi program fine, but 'use CGI::Session' gives me an internal server error.

What is the likely cause - is the CGI::Session module not installed with the perl at my isp? How might I get around this?

Replies are listed 'Best First'.
Re: CGI::Session isn't installed?
by wfsp (Abbot) on May 16, 2007 at 16:48 UTC
    hi mwhiting,

    ...CGI::Session module not installed...
    Possibly. Or one of its dependancies or a version of one of its dependancies (but that would show up later).

    Try adding

    use strict; use warnings; use CGI::Carp qw(fatalsToBrowser);
    at the top of the script and see if that sheds any more light on the subject.

    Show us a (short) example of what you are using.

    update: fixed typos

      OK, so that does shed a little light. This is what I get back:

      Software error: Can't locate CGI/Session.pm in @INC (@INC contains: /usr/local/lib/per +l5/site_perl/5.8.7/mach /usr/local/lib/perl5/site_perl/5.8.7 /usr/loc +al/lib/perl5/site_perl /usr/local/lib/perl5/5.8.7/BSDPAN /usr/local/l +ib/perl5/5.8.7/mach /usr/local/lib/perl5/5.8.7 .) at libsearch-mw.cgi + line 9. BEGIN failed--compilation aborted at libsearch-mw.cgi line 9.

      Here's my general code. It's a short program containing basically nothing so I can get this working. When it does I can splice it into what I'm working on.

      #!/usr/bin/perl use warnings; use CGI::Carp qw(fatalsToBrowser); use Cwd; use LWP::Simple; use CGI; use CGI::Session; my $cgi = new CGI; my $sid = $cgi->param('CGISESSID') || undef; my $session = new CGI::Session("driver:File", $cgi, {Directory=>'/tmp' +});

      It looks to me like the module is not there.

      Thanks in advance.

      Michael

        That's correct, the module appears to not be installed. This leaves you with two courses of action:

        1. Ask your ISP if they will install it for you. Many ISPs are willing to do this, but many more are not. So ask very nicely.

        2. Since, AFAIK, this is a pure perl module, you could download it from CPAN, unzip it, and FTP the entire lib directory into the directory you're running your scripts from, most likely the cgi-bin.

        __________
        Systems development is like banging your head against a wall...
        It's usually very painful, but if you're persistent, you'll get through it.

Re: CGI::Session isn't installed?
by Polonius (Friar) on May 16, 2007 at 18:38 UTC
Re: CGI::Session isn't installed?
by leocharre (Priest) on May 16, 2007 at 22:11 UTC

    CGI::Session is not such an obscure module. Ask them (host) to install it. If they don't- and you plan on doing perl regularly- ditch 'em. Save these troubles for real 'obscure' or possibly problematic modules like Want or Smart::Comments (I've had fuzz installing these wonderful modules without root)

    When you get to other modules later on.. You really should be using an ssh connection and the command line interface for cpan. This can work wonders on a hosted account.

      Having it installed is obviously the best solution. The problem is, it isn't just my ISP, this is a script that gets run on any of our customer's systems. We can't really be going & getting it installed by every customer's local ISP ..... or if we were to try, they wouldn't all do it, as you said. I need a solution that I can implement myself from the script end without relying on the user's server. It sounds like installing the module to a folder, along with the rest of the installation process, would accomplish that.

      Cookie functionality is also in the CGI module, is it not. I don't think I would require the CGI::Session module for that.

        Sounds to me like you're developing something that you need in various clients' hosting accounts- of their choosing. I have experience with this. I would honestly do one of three things-
        • host them yourself (rent a server, $150/$300 mo or so)
        • pick the host for all your clients- questions asked, ok.. but you make the final decision.
        • quit, seriously. Go find another job where management has some common sense.

        We do general IT, and one of the things we do, is optionally manage client websites. I tried solving problems with installer scripts, etc etc. But after 5 sites, it gets hard... Actually, it gets messy and dangerous to your business. Things will break, and if you don't have a standard method of installation (cpan), things will break, it will be hard to update modules, clients will complain, management will complain, you will be in devhell.

        Use the shell and cpan- or have the isp install the stuff- or do the hosting yourself. Otherwise you can't update the modules, can you? Sorry to go on about this, I just really think you're headed into a nightmare.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found