I wrote a very simple redirect html cgi form and tested it to verify it worked, then I called the page from a browser. The error log says it could not find CGI::Session in the designated paths. and yet it is in the path. How can I fix this path issue? error message says it can't find it, but its in the path, tiny script works on the command line.

[Thu Feb 06 00:09:56 2014] [error] [client 153.64.146.203] Can't locat +e CGI/Session/ErrorHandler.pm in @INC (@INC contains: /usr/lib/perl5/ +5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5 +/site_perl/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/ +5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi /u +sr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl .) at /usr +/lib/perl5/5.10.0/CGI/Session.pm line 4. audrey:/usr/lib/perl5/5.10.0/CGI # find /usr/lib/perl5 -name Session.p +m /usr/lib/perl5/site_perl/5.10.0/CGI/Session.pm
#!/usr/bin/perl -w use strict; use CGI::Session; #use lib "/usr/lib/perl5/site_perl/5.10.0/"; # no cookie no worky my $session = CGI::Session->load(); redirect() if ($session->is_empty); 1; sub redirect { print q(Content-type: text/html <html> <head> <title>Redirect to logon </title> </head> <body> <META HTTP-EQUIV="refresh" CONTENT="10;URL=https://audrey/logon.html"> Logon Expired or not valid... Redirecting </body> </html> );

############Found MY Own Fix############ Oh buggy day one security issue, if I try to run perl as web user AND I need to access one of these libraries then I will get a premature end of file error. What I found was the perl5 library directories are created as drwxr-x--- This blocks the “other” user. A simple workaround is to change the directory permissions for the particular part of the library that needs to be used. OR, add the web user to the group root, (NOT!) Script to find the offending directories: find /usr/lib/perl5 -type d ! -perm /o=r -print


In reply to CGI:Session found but not by fitgeek

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.