Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Do I need to free allocated space in an END sub?

by Joost (Canon)
on Dec 10, 2004 at 16:54 UTC ( #413908=note: print w/replies, xml ) Need Help??


in reply to Re^2: Do I need to free allocated space in an END sub?
in thread Do I need to free allocated space in an END sub?

If BEGIN is not called for each request then how the come END is?

I think the reason is, that Apache::Registry is meant to make it easy to run CGI scripts as mod_perl scripts. Since END blocks in CGI scripts are run after each request, they also run after each request when using Apache::Registry. I don't like it either, but apparantly, that's how it is.

As for BEGIN blocks: if you really want to run them at the right time, you'd have to remove all the loaded code and variables from the interpreter before handling the request (and then reload all the code) - it would probably make Apache::Registry scripts almost as slow as normal CGI scripts.

  • Comment on Re^3: Do I need to free allocated space in an END sub?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://413908]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-11-28 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?