Practical mod_perl / HTML Book /



previous page: 6.4.10. END Blocks
  
page up: HTML Version of the book
  
next page: 6.5.1. $^T and time( )

6.5. CHECK and INIT Blocks


The CHECK and INIT blocks run when compilation is complete, but before the program starts. CHECK can mean "checkpoint," "double-check," or even just "stop." INIT stands for "initialization." The difference is subtle: CHECK blocks are run just after the compilation ends, whereas INIT blocks are run just before the runtime begins (hence, the -c command-line flag to Perl runs up to CHECK blocks but not INIT blocks).

Perl calls these blocks only during perl_parse( ), which mod_perl calls once at startup time. Therefore, CHECK and INIT blocks don't work in mod_perl, for the same reason these don't:

panic% perl -e 'eval qq(CHECK { print "ok\n" })'
panic% perl -e 'eval qq(INIT  { print "ok\n" })'

 

Continue to:

  • prev: 6.4.10. END Blocks
  • Table of Contents
  • next: 6.5.1. $^T and time( )







TOP
previous page: 6.4.10. END Blocks
  
page up: HTML Version of the book
  
next page: 6.5.1. $^T and time( )


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com