Re: Why people not using mod_perl

2009-09-17 Thread Kiran Kumar

 Emacs, Vim, Komodo, and others are equally as capable in the Perl
 domain.  What you don't have as much of in the Perl domain is the
 commercial support for those tools, with the exception of ActiveState.
  I just pulled down the latest copy of Komodo and took it for a spin;
 though however many times I try out the GUI based editors I end up
 going back to cli based tools because they are so much more performant
 when you've been using them a while and have customized them for your
 particular needs.

There is also Padre (http://padre.perlide.org/) , You can write
plugins and customize to your needs, there are already lots of plugins
available  http://search.cpan.org/search?query=padre%3A%3Apluginmode=all


Re: PerlRun Subroutine redefine warnings

2009-08-27 Thread Kiran Kumar
Hi Mike,
Thanks for your reply,  If you check my script there is no other
subroutine with the same name and I do not import any modules , I
renamed the subroutine to foo and I still get the same warnings.


Thanks,
Kiran


On Wed, Aug 26, 2009 at 8:20 PM, Mike OKm...@acorg.com wrote:
 This error occurs when you have two subroutines with the same name.

 Mike O'Krongli
 President and CTO
 Acorg Inc
 519 432-1185
 - Original Message - From: Kiran Kumar mkira...@gmail.com
 To: modperl@perl.apache.org
 Sent: Wednesday, August 26, 2009 8:07 PM
 Subject: PerlRun Subroutine redefine warnings


 Hi,
  I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine
 redefined warnings. Perlrun reloads the cgi on each request so why do
 I keep getting these warnings ? Is there any other way to avoid this
 other than no warnings qw/redefine/ in my scripts. Am I missing
 something here ?.

  Here is a minimal script I tested with

 #!/usr/bin/perl
 use strict;
 use warnings;
 print Content-type:text/html \n\n;

 test();
 test();


 sub test {
 print  in test \n;
 }

  and here is my httpd.conf

        PerlModule ModPerl::PerlRun
     Location /cgi-bin
         SetHandler perl-script
         PerlHandler ModPerl::PerlRun
         PerlSetVar ReloadAll Off

         PerlResponseHandler +ModPerl::PerlRun
         PerlOptions +ParseHeaders
         PerlSendHeader On
         Options +ExecCGI
     /Location
     PerlRequire /opt/nms/www/cgi-bin/startup.pl
     # I modify @INC in startup.pl and do not load any modules

 Error in the error_log
 Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22.
 Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10.

 Thanks,
 Kiran





PerlRun Subroutine redefine warnings

2009-08-26 Thread Kiran Kumar
Hi,
  I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine
redefined warnings. Perlrun reloads the cgi on each request so why do
I keep getting these warnings ? Is there any other way to avoid this
other than no warnings qw/redefine/ in my scripts. Am I missing
something here ?.

  Here is a minimal script I tested with

#!/usr/bin/perl
use strict;
use warnings;
print Content-type:text/html \n\n;

test();
test();


sub test {
 print  in test \n;
}

  and here is my httpd.conf

 PerlModule ModPerl::PerlRun
  Location /cgi-bin
  SetHandler perl-script
  PerlHandler ModPerl::PerlRun
  PerlSetVar ReloadAll Off

  PerlResponseHandler +ModPerl::PerlRun
  PerlOptions +ParseHeaders
  PerlSendHeader On
  Options +ExecCGI
  /Location
  PerlRequire /opt/nms/www/cgi-bin/startup.pl
  # I modify @INC in startup.pl and do not load any modules

Error in the error_log
Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22.
Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10.

Thanks,
Kiran


Modperl::PerlRun Reload modules

2009-08-07 Thread Kiran Kumar
Hi,
I am working on migrating some legacy code from cgi to run under
Modperl::Perlrun. Perlrun reloads the cgi scripts for each requests
but the perl modules are still cached. We ran into an issue wherein
there were some modules that created closures and since these modules
were cached we could not run them under modperl::perlrun.

In the long run we would like to clean up these modules , for now we
want them to run under Perlrun without making any change to the
modules

I looked around to see if there was a way to reload specified modules
on each request but did not come across any way to do this.

I looked at the way Apache::Reload reloads modules and came up with a
way that seems to be reload the module each time .

  # In httpd.conf
  PerlCleanupHandler sub { delete $INC{'Dirty.pm'};
ModPerl::Util::unload_package('Dirty'); require 'Dirty.pm'; }

Am I missing something here or Is there a better way to reload the
required modules on each request under PerlRun.

Thanks ,
Kiran