Thanks for that...makes perfect sense.
for those that read this later. I installed Apache2::compat from
cpan.organd added PerlModule Apache2::compat to
httpd.conf. Provides backwards compatibility for mod_perl2 to mod_perl.
Performance hit comes with it tho.
Regards
Darragh
On Dec 10, 2007 1:45 PM, namotco < [EMAIL PROTECTED]> wrote:
> $r->header_in('User-Agent');
> is from mod_perl 1.0, not mod_perl2.:
>
>
>
> http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_err_header_out_
>
>
> On Dec 9, 2007, at 7:45 PM, Darragh Gammell wrote:
>
> Hi
>
> Ive recently installed Mason 1.37 on Ubuntu Gutsy (Linux 2.6.22-14-server)
> with Perl 5.8.8, Apache2 and mod_perl2
>
> Apache config is:
>
> PerlModule HTML::Mason::ApacheHandler
>
> PerlSetVar MasonCompRoot /home/mc2/public_html
> PerlSetVar MasonDataDir /home/mc2/mason
>
> <Directory "/home/mc2/public_html">
> #Options -Indexes
> #HTML::Mason handles any .html files
> <FilesMatch "\.html">
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </FilesMatch>
> # Deny .comp files from being accessed directly
> </Directory>
>
> Running through a few tests from the developers manual:
> http://www.masonhq.com/docs/manual/Devel.html
>
> The simple component example works fine and displays the correct details
> via my browser.
>
> [EMAIL PROTECTED]:/home/mc2/public_html# vi index.html
> Darragh
>
> <% 2+2 %>
>
> <%perl>
> my $noun = 'World';
> my @time = localtime;
> </%perl>
> Hello <% $noun %>,
> % if ( $time[2] < 12 ) {
> good morning.
> % } else {
> good afternoon.
> % }
>
>
>
>
> But when I proceed to the next section and try to use
>
> % my $ua = $r->header_in('User-Agent');
>
> I get errors back.
>
> Can't locate object method "header_in" via package "Apache2::RequestRec"
> at /home/mc2/public_html/index.html line 19.
>
> Trace begun at /usr/local/share/perl/5.8.8/HTML/Mason/Exceptions.pm line 129
> HTML::Mason::Exceptions::rethrow_exception('Can\'t locate object method
> "header_in" via package "Apache2::RequestRec" at
> /home/mc2/public_html/index.html line 19.^J') called at
> /home/mc2/public_html/index.html line 19
> HTML::Mason::Commands::__ANON__ at
> /usr/local/share/perl/5.8.8/HTML/Mason/Component.pm line 135
> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x11807f0)')
> called at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 1257
> eval {...} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 1252
> HTML::Mason::Request::comp(undef, undef, undef) called at
> /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 466
> eval {...} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 466
> eval {...} at /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm line 418
> HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0x11bf0e0)')
> called at /usr/local/share/perl/5.8.8/HTML/Mason/ApacheHandler.pm line 168
> HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0x11bf0e0)')
> called at /usr/local/share/perl/5.8.8/HTML/Mason/ApacheHandler.pm line 826
> HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0x1180610)',
> 'Apache2::RequestRec=SCALAR(0x9b2390)') called at (eval 39) line 8
> HTML::Mason::ApacheHandler::handler('HTML::Mason::ApacheHandler',
> 'Apache2::RequestRec=SCALAR(0x9b2390)') called at -e line 0
> eval {...} at -e line 0
>
>
> Can someone point me in the right direction for fixing this please.
>
> Regards
>
> Darragh
>
> PS: System details below
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> perl version:
>
> [EMAIL PROTECTED]:/tmp/HTML-Mason-1.37# perl -v
>
> This is perl, v5.8.8 built for x86_64-linux-gnu-thread-multi
>
>
>
>
> [EMAIL PROTECTED]:/etc/apache2# apache2 -v
> Server version: Apache/2.2.4 (Ubuntu)
> Server built: Oct 5 2007 00:29:21
>
>
>
>
> See below for make test and install:
>
>
> [EMAIL PROTECTED]:/tmp/HTML- Mason-1.37# make test
> /usr/bin/perl Build --makefile_env_macros 1 test
> Converting custom POD tags in files under blib
> t/01-syntax...................ok
> t/01a-comp-calls..............ok
> t/02-sections.................ok
> t/02a-filter..................ok
> t/04-misc.....................ok
> t/05-request..................ok
> t/05a-stack-corruption........ok
> t/06-compiler.................ok
> t/06a-compiler_obj............ok
> t/06b-compiler-named-subs.....ok
> t/07-interp...................ok
> t/07a-interp-mcr..............ok
> t/07b-interp-static-source....ok
> t/08-ah.......................skipped
> all skipped: $test_data->{is_maintainer} is not true or
> $test_data->{apache_dir} is not a directory
> t/09-component................ok
> t/09a-comp_content............ok
> t/10-cache....................ok
> t/10a-cache-1.0x..............ok
> t/11-inherit..................ok
> t/12-taint....................ok
> t/13-errors...................ok
> t/14-cgi......................ok
> t/14a-fake_apache.............ok
> t/15-subclass.................ok
> t/16-live_cgi.................skipped
> all skipped: $test_data->{apache_dir} is not a directory
> t/17-print....................ok
> t/18-leak.....................ok
> t/19-subrequest...............ok
> t/20-plugins..................ok
> t/21-escapes..................ok
> t/22-path-security............ok
> t/23-leak2....................skipped
> all skipped: These tests require Test::Memory::Cycle to run.
> t/24-tools....................ok
> t/99-pod......................ok
> All tests successful, 3 tests skipped.
> Files=34, Tests=532, 26 wallclock secs ( 5.82 cusr + 1.32 csys = 7.14CPU)
>
>
> [EMAIL PROTECTED]:/tmp/HTML-Mason-1.37# make install
> /usr/bin/perl Build --makefile_env_macros 1 install
> Converting custom POD tags in files under blib
> Manifying blib/lib/HTML/Mason/Component/Subcomponent.pm ->
> blib/libdoc/HTML::Mason::Component:: Subcomponent.3pm
> Manifying blib/lib/HTML/Mason/Component/FileBased.pm ->
> blib/libdoc/HTML::Mason::Component::FileBased.3pm
> Manifying blib/lib/HTML/Mason/Plugin.pm -> blib/libdoc/HTML::Mason::
> Plugin.3pm
> Manifying blib/lib/HTML/Mason/Params.pod -> blib/libdoc/HTML::Mason::
> Params.3pm
> Manifying blib/lib/HTML/Mason/Admin.pod -> blib/libdoc/HTML::Mason::
> Admin.3pm
> Manifying blib/lib/HTML/Mason/Plugin/Context.pm ->
> blib/libdoc/HTML::Mason::Plugin::Context.3pm
> Manifying blib/lib/HTML/Mason/Subclassing.pod -> blib/libdoc/HTML::Mason::
> Subclassing.3pm
> Manifying blib/lib/HTML/Mason/CGIHandler.pm -> blib/libdoc/HTML::Mason::
> CGIHandler.3pm
> Manifying blib/lib/HTML/Mason/Component.pm -> blib/libdoc/HTML::Mason::
> Component.3pm
> Manifying blib/lib/HTML/Mason/Tests.pm -> blib/libdoc/HTML::Mason::
> Tests.3pm
> Manifying blib/lib/HTML/Mason/ApacheHandler.pm ->
> blib/libdoc/HTML::Mason:: ApacheHandler.3pm
> Manifying blib/lib/HTML/Mason/Resolver/File.pm ->
> blib/libdoc/HTML::Mason::Resolver::File.3pm
> Manifying blib/lib/HTML/Mason/Cache/BaseCache.pm ->
> blib/libdoc/HTML::Mason::Cache:: BaseCache.3pm
> Manifying blib/lib/Bundle/HTML/Mason.pm -> blib/libdoc/Bundle::HTML::
> Mason.3pm
> Manifying blib/lib/HTML/Mason/Tools.pm -> blib/libdoc/HTML::Mason::
> Tools.3pm
> Manifying blib/lib/HTML/Mason/ComponentSource.pm ->
> blib/libdoc/HTML::Mason:: ComponentSource.3pm
> Manifying blib/lib/HTML/Mason.pm -> blib/libdoc/HTML::Mason.3pm
> Manifying blib/lib/HTML/Mason/Compiler.pm -> blib/libdoc/HTML::Mason::
> Compiler.3pm
> Manifying blib/lib/HTML/Mason/Request.pm -> blib/libdoc/HTML::Mason::
> Request.3pm
> Manifying blib/lib/HTML/Mason/Parser.pm -> blib/libdoc/HTML::Mason::
> Parser.3pm
> Manifying blib/lib/HTML/Mason/Resolver/Null.pm ->
> blib/libdoc/HTML::Mason::Resolver::Null.3pm
> Manifying blib/lib/HTML/Mason/Devel.pod -> blib/libdoc/HTML::Mason::
> Devel.3pm
> Manifying blib/lib/HTML/Mason/Exceptions.pm -> blib/libdoc/HTML::Mason::
> Exceptions.3pm
> Manifying blib/lib/HTML/Mason/Resolver.pm -> blib/libdoc/HTML::Mason::
> Resolver.3pm
> Manifying blib/lib/HTML/Mason/Utils.pm -> blib/libdoc/HTML::Mason::
> Utils.3pm
> Manifying blib/lib/HTML/Mason/FakeApache.pm -> blib/libdoc/HTML::Mason::
> FakeApache.3pm
> Manifying blib/lib/HTML/Mason/Interp.pm -> blib/libdoc/HTML::Mason::
> Interp.3pm
> Manifying blib/lib/HTML/Mason/Lexer.pm -> blib/libdoc/HTML::Mason::
> Lexer.3pm
> Manifying blib/lib/HTML/Mason/Escapes.pm -> blib/libdoc/HTML::Mason::
> Escapes.3pm
> Manifying blib/lib/HTML/Mason/Compiler/ToObject.pm ->
> blib/libdoc/HTML::Mason::Compiler::ToObject.3pm
> Manifying blib/lib/HTML/Mason/MethodMaker.pm -> blib/libdoc/HTML::Mason::
> MethodMaker.3pm
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Exceptions.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Component.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Plugin.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Parser.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Interp.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Tools.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Compiler.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/ApacheHandler.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Lexer.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Utils.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/CGIHandler.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Handler.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/FakeApache.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/ComponentSource.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/MethodMaker.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Escapes.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Tests.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Request.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Resolver.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Devel.pod (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Params.pod (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Subclassing.pod
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Admin.pod (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Component/Subcomponent.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Component/FileBased.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Resolver/File.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Resolver/Null.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Plugin/Context.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Compiler/ToObject.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/HTML/Mason/Cache/BaseCache.pm
> (unchanged)
> Skipping /usr/local/share/perl/5.8.8/Bundle/HTML/Mason.pm (unchanged)
> Skipping /usr/local/share/perl/5.8.8/Apache/Mason.pm (unchanged)
> Installing /usr/local/man/man3/HTML::Mason::Component::Subcomponent.3pm
> Installing /usr/local/man/man3/HTML::Mason::Component::FileBased.3pm
> Installing /usr/local/man/man3/HTML::Mason::Plugin.3pm
> Installing /usr/local/man/man3/HTML::Mason:: Params.3pm
> Installing /usr/local/man/man3/HTML::Mason::Admin.3pm
> Installing /usr/local/man/man3/HTML::Mason::Plugin::Context.3pm
> Installing /usr/local/man/man3/HTML::Mason::Subclassing.3pm
> Installing /usr/local/man/man3/HTML::Mason:: CGIHandler.3pm
> Installing /usr/local/man/man3/HTML::Mason::Component.3pm
> Installing /usr/local/man/man3/HTML::Mason::Tests.3pm
> Installing /usr/local/man/man3/HTML::Mason::ApacheHandler.3pm
> Installing /usr/local/man/man3/HTML::Mason::Resolver:: File.3pm
> Installing /usr/local/man/man3/HTML::Mason::Cache::BaseCache.3pm
> Installing /usr/local/man/man3/Bundle::HTML::Mason.3pm
> Installing /usr/local/man/man3/HTML::Mason::Tools.3pm
> Installing /usr/local/man/man3/HTML::Mason:: ComponentSource.3pm
> Installing /usr/local/man/man3/HTML::Mason.3pm
> Installing /usr/local/man/man3/HTML::Mason::Compiler.3pm
> Installing /usr/local/man/man3/HTML::Mason::Request.3pm
> Installing /usr/local/man/man3/HTML::Mason:: Parser.3pm
> Installing /usr/local/man/man3/HTML::Mason::Resolver::Null.3pm
> Installing /usr/local/man/man3/HTML::Mason::Devel.3pm
> Installing /usr/local/man/man3/HTML::Mason::Exceptions.3pm
> Installing /usr/local/man/man3/HTML::Mason:: Resolver.3pm
> Installing /usr/local/man/man3/HTML::Mason::Utils.3pm
> Installing /usr/local/man/man3/HTML::Mason::FakeApache.3pm
> Installing /usr/local/man/man3/HTML::Mason::Interp.3pm
> Installing /usr/local/man/man3/HTML::Mason:: Lexer.3pm
> Installing /usr/local/man/man3/HTML::Mason::Escapes.3pm
> Installing /usr/local/man/man3/HTML::Mason::Compiler::ToObject.3pm
> Installing /usr/local/man/man3/HTML::Mason::MethodMaker.3pm
> Skipping /usr/local/bin/convert0.6.pl (unchanged)
> Skipping /usr/local/bin/convert0.8.pl (unchanged)
> Skipping /usr/local/bin/convert0.8.README (unchanged)
> Skipping /usr/local/bin/mason.pl (unchanged)
> Skipping /usr/local/bin/convert0.6.README (unchanged)
> Writing /usr/local/lib/perl/5.8.8/auto/HTML/Mason/.packlist
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>
> http://sourceforge.net/services/buy/index.php_______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users