in reply to CGI::Application::Session and Inheritance

What does your cgi script look like? I suspect you should be creating an instance of myTest::module1 instead of myTest::Index and changing home() to look something like:
sub home { # $self->start_mode('home'); my $self = shift; my $tmpl = $self->load_tmpl('index.tmpl'); my $session = $self->session; my $data = $session->param_hashref(); $self->add_item(); $session->param("key1","value1"); # Works as expected $tmpl->param(DATA => Dumper($data)); return $tmpl->output; }

Replies are listed 'Best First'.
Re^2: CGI::Application::Session and Inheritance
by gman (Friar) on Apr 19, 2005 at 18:08 UTC
    Here is my CGI script. pretty much taken right out of CGI::Application


    #!/usr/bin/perl -w use myTest::Index; use strict; my $web = myTest::Index->new(); $web->run();
      Create an instance of myTest::module1, not myTest::Index, and make the changes to home() that I gave you earlier. Your app will work now.
        Ok, sorrry I am still a little (ok, a lot) confused.
        Right now I have (cgi script)->(Index.pm)->(module1.pm)
        Are you saying I should be doing everything that requires access to my session object needs to be done in Index.pm? Or if I create an instance of module1 in my cgi script, it must be done in that module? Thanks for your insite, I will contine to try to make sense yours and Joost's sugestions. Thanks