in reply to Can't locate object method "content_type"

Your first script can't work when called as a program:

> perl -w tmp.pl Can't call method "content_type" on an undefined value at tmp.pl line +5.

So whatever you're calling "direct" is a different program from what you're calling through mod_perl.

Maybe your instance of modeperl is something different?

Replies are listed 'Best First'.
Re^2: Can't locate object method "content_type"
by gaja (Initiate) on May 02, 2014 at 07:41 UTC
    Hi Corion, Thanks for your quickest reply. Myself its working properly and the output as Now is: Fri May 2 07:25:11 2014 But the problem is when i added a filters in httpd.conf file like
    SetHandler modeperl PerlResponseHandler Apache2::AddFilterDyn
    After i restarting a apache and running the index.pl file then shows a error as Can't locate object method "content_type" via package "Apache2::Filter"
        Hi Finally i found the solution. in .htaccess file need to add this.
        SetHandler perl-script PerlOptions +MergeHandlers PerlResponseHandler Apache2::AddFilterDyn
        Actually I already have one PerlResponseHandler ModPerl::Registry So, my AddFilterDyn filter is not working proper. PerlOptions +MergeHandlers gives the solution for it. Thanks all.
        Hi Finally i found the solution. in .htaccess file need to add this.
        SetHandler perl-script PerlOptions +MergeHandlers PerlResponseHandler Apache2::AddFilterDyn
        Actually I already have one default PerlResponseHandler ModPerl::Registry So, my AddFilterDyn filter is not working proper. PerlOptions +MergeHandlers gives the solution for it. Thanks all.
Re^2: Can't locate object method "content_type"
by gaja (Initiate) on May 08, 2014 at 13:06 UTC
    Hi Finally i found the solution. in .htaccess file need to add this.
    SetHandler perl-script PerlOptions +MergeHandlers PerlResponseHandler Apache2::AddFilterDyn
    Actually I already have one PerlResponseHandler ModPerl::Registry So, my AddFilterDyn filter is not working proper. PerlOptions +MergeHandlers gives the solution for it. Thanks all.