I'm using CGI::Application and just added CGI::Session for session handling. Now I get the error message:

Error executing run mode 'login_process': Can't locate auto/CGI/Session/File/expired.al in @INC.

@INC contains:

/usr/local/lib/perl5/5.8.2/i386-freebsd
/usr/local/lib/perl5/5.8.2
/usr/local/lib/perl5/site_perl/5.8.2/i386-freebsd
/usr/local/lib/perl5/site_perl/5.8.2
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl

The relevant code snippets follow: the cgiapp_prerun method where I get the session and check to see if the user is logged in. If they are not logged in, then I divert them to the 'login_form', and then the error is generated when I try to switch modes.

### Pre-runmode method sub cgiapp_prerun { my $self = shift; my $next_mode = shift; my $q = $self->query(); $self->_get_session(); ### If a login/help runmode, then you're finished... if ($next_mode =~ m/^help_/ || $next_mode =~ m/^login_/ || $next_mode =~ m/^splash_screen_/ ) { return; } ### All other runmodes require that you be logged in... unless ($Session->param("_Is-Logged_In")) { ### Save current runmode and passed parameters so that we can +re-invoke it after ### the user gets logged in... $Session->save_param($q); $Session->param("Logged-In-Runmode", $next_mode); $self->prerun_mode("login_form"); } return; } ### Get a session for this invocation sub _get_session { my $self = shift; my $q = $self->query(); $Session = new CGI::Session(undef, $q, {Directory=>"/tmp"}), unles +s ($Session); $SessionID = $Session->id(); if ($Session->is_new() ) { $Session->expire('+1y'); my $cookie = $q->cookie(-name => "CGISESSID", -value => $SessionID, -expires => '+1y'); $self->header_props(-cookie => $cookie); } }

When I do a find, the "expired.al" file is not found. However, find does locate the following files:


/usr/local/lib/perl5/site_perl/5.8.2/auto/CGI/Session/expire.al
/usr/local/lib/perl5/site_perl/5.8.2/auto/CGI/Session/expires.al

I've checked CPAN (perl -MCPAN ...) and I have the latest version (3.95). Just to make sure, I downloaded it again and forced an install.

Curiously, when I ask the CPAN module to check for reinstall recommendations, the CGI::Session module isn't listed ("72 installed modules have no parseable version number"), but when I look at the CGI::Session code, there's a version number there:

use vars qw($VERSION $REVISION $errstr $IP_MATCH $NAME $API_3 $FROZEN) +; ($REVISION) = '$Revision: 3.12.2.7.2.4 $' =~ m/Revision:\s*(\S+)/; $VERSION = '3.95'; $NAME = 'CGISESSID';

I've checked the various docs/lists but can't find anything... I hope you have some suggestions for me.

Thanks...jon

In reply to CGI::Session autoload failure by JESii

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.