I'm trying to copy a WEB application from a Sun Spark environment to a Linux environment. I ~believe~ I have Perl, Apache2, mod_perl and Mason installed correctly but when I try some simple code using "autohandler", I get errors.

What I get is:

error: Can't locate object method "session" via package "HTML::Mas +on::Request::ApacheHandler" at /var/www/html/autohandler line 13, <DA +TA> line 225. context: ... 9: $m->clear_buffer(); 10: 11: use Time::HiRes qw(gettimeofday tv_interval); 12: my $starttime=[gettimeofday]; 13: $m->session->{title}="Web"; 14: my $url="http://xxx.xxx.xxx.xxx"; 15: $m->session->{url}=$url; 16: 17: if(!defined $m->session->{debug})

the trace for this is:

Can't locate object method "session" via package "HTML::Mason::Request +::ApacheHandler" at /var/www/html/autohandler line 13, <DATA> line 22 +5. Trace begun at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Exceptions.pm + line 129 HTML::Mason::Exceptions::rethrow_exception('Can\'t locate object metho +d "session" via package "HTML::Mason::Request::ApacheHandler" at /var +/www/html/autohandler line 13, <DATA> line 225.^J') called at /var/ww +w/html/autohandler line 13 HTML::Mason::Commands::__ANON__ at /usr/lib/perl5/site_perl/5.8.8/HTML +/Mason/Component.pm line 138 HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x +2ae3592e5c70)') called at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/R +equest.pm line 1300 eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm lin +e 1295 HTML::Mason::Request::comp(undef, undef, undef) called at /usr/lib/per +l5/site_perl/5.8.8/HTML/Mason/Request.pm line 484 eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm lin +e 484 eval {...} at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm lin +e 436 HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0 +x2ae35866a9d0)') called at /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ +ApacheHandler.pm line 168 HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::Apach +eHandler=HASH(0x2ae35866a9d0)') called at /usr/lib/perl5/site_perl/5. +8.8/HTML/Mason/ApacheHandler.pm line 825 HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler +=HASH(0x2ae357fca7b0)', 'Apache2::RequestRec=SCALAR(0x2ae3557ca5a0)') + called at (eval 27) line 8 HTML::Mason::ApacheHandler::handler('HTML::Mason::ApacheHandler', 'Apa +che2::RequestRec=SCALAR(0x2ae3557ca5a0)') called at -e line 0 eval {...} at -e line 0

If I change the name of the autohandler file, the test html code I have works.

I'm new to Mason and this was a new Mason/mod_perl install so I ~think~ it might be a configuration parameter someplace, but I have no idea where to look. If someone can just "point" me in the right direction I would greatly appreciate it.


In reply to Perl Apache Mason Problem by EEddieEmm

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.