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

Hi Monks, Would you please help on the following scenario? A CGI::Session module has been installed on Solaris,sun4u sparc SUNW,Sun-Fire-480R. The user is tester, without admin privilege. A command is used
perl Makefile.PL LIB=/home/tester/PerlModule
Then, a script would be used to test the CGI::Session functionality.
#!/usr/bin/perl -w use lib '/home/tester/PerlModule'; use CGI::Session; my $session = new CGI::Session() or die CGI::Session->errstr; print "test end***\n";
After run the script, following error is shown.
Use of uninitialized value in concatenation (.) or string at /home/sdb +admin/PerlModule/CGI/Session.pm line 128. Can't locate object method "generate_id" via package "CGI::Session::ID +::" (perhaps you forgot to load "CGI::Session::ID::"?) at /home/sdbad +min/PerlModule/CGI/Session.pm line 74.
Could you pls help to analyse this issue? Thank you.

Replies are listed 'Best First'.
Re: CGI::Session not work
by Your Mother (Archbishop) on Dec 08, 2007 at 23:35 UTC

    Looks like your installed version is broken and the local version you're trying to call isn't really there.

    /home/sdbadmin/PerlModule/CGI/Session.pm <-- error ne /home/tester/PerlModule <-- attempted but unused path

    Look in /home/tester/PerlModule and you will probably see that CGI::Session is a) missing, b) in a slightly deeper path like perl5/lib or something.

      Thanks for the reply. Then, I've tried to installed it in /home/sdbadmin and change the related script.
      #!/usr/bin/perl use lib '/home/sdbadmin/PerlModule'; use CGI::Session; my $session = new CGI::Session() or die CGI::Session->errstr; print "test end***\n";
      However, the error message is the same. Could you pls help ? Is it meaning that installaion of CGI::Session crashed? Error:
      <b>Use of uninitialized value in concatenation (.) or string at /home/ +sdbadmin/PerlModule/CGI/Session.pm line 128. Can't locate object method "generate_id" via package "CGI::Session::ID +::" (perhaps you forgot to load "CGI::Session::ID::"?) at /home/sdbad +min/PerlModule/CGI/Session.pm line 74. </b>

        Your installation looks bad/partial. Try from the CPAN shell -- [sudo] perl -MCPAN -e shell + install CGI::Session -- or from scratch with a fresh download.