Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Modperl::PerlRun Reload modules

by mkirank (Chaplain)
on Aug 03, 2009 at 22:08 UTC ( #785570=perlquestion: print w/replies, xml ) Need Help??
mkirank has asked for the wisdom of the Perl Monks concerning the following question:

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 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

Replies are listed 'Best First'.
Re: Modperl::PerlRun Reload modules
by Anonymous Monk on Aug 04, 2009 at 04:36 UTC
    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

    Not gonna happen.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://785570]
Approved by broomduster
help
Chatterbox?
[abner]: yes. i am familiar with mysql but ignorant about how to get around the fact that placeholders can only represent single scalar values.
[abner]: my $sth = $dbh->prepare(' SELECT * FROM charge WHERE cpt = ?') or die "Couldn't prepare statement: " . $dbh->errstr;
[abner]: what if i want SELECT * FROM charge WHERE col1 = x and col2 = y?
[atcroft]: abner: So you are wanting to do something like my $sth = $dbh->prepare(' SELECT * FROM charge WHERE col1 = ? and col2 = ?;'); $sth->execute(' asdf', 'asdw');?
[atcroft]: (Full disclosure: I may have the idea right but small typographical errors, so please test any code I suggest. :) )

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-01-24 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (201 votes). Check out past polls.