Practical mod_perl / HTML Book /



previous page: 21.1.1. The Importance of Warnings
  
page up: HTML Version of the book
  
next page: 21.1.2. Curing "Internal Server Error" Problems

21.1.1.1. The diagnostics pragma


This pragma extends the terse diagnostics normally emitted during the compilation and runtime phases and augments them with the more verbose and endearing descriptions found in the perldiag manpage.

Like any other pragma, diagnostics is invoked with use, by placing:

use diagnostics;

in your program. This also turns warnings mode on for the scope of the program.

This pragma is especially useful when you are new to Perl and want a better explanation of the errors and warnings. It's also helpful when you encounter some warning you've never seen before—e.g., when a new warning has been introduced in an upgraded version of Perl.

You may not want to leave diagnostics mode on for your production server. For each warning, diagnostics mode generates about ten times more output than warnings mode. If your code generates warnings that go into the error_log file, with the diagnostics pragma you will use disk space much faster.

Diagnostics mode adds a large performance overhead in comparison with just having the warnings mode on. You can see the benchmark results in Chapter 9.

 

Continue to:

  • prev: 21.1.1. The Importance of Warnings
  • Table of Contents
  • next: 21.1.2. Curing "Internal Server Error" Problems







TOP
previous page: 21.1.1. The Importance of Warnings
  
page up: HTML Version of the book
  
next page: 21.1.2. Curing "Internal Server Error" Problems


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