use strict; use warnings; use diagnostics;
This will among many good things make sure you declare everything in the right namespace, give you extensive warnings about weird things you write (which 9 times out of 10 will be bugs) and when your script encounters an error (compile-time or run-time) it will dump very useful information about what exactly went wrong.
Do not take these pragmas out when your script goes into production unless you expect your script to be very processor intensive or for it to be called very frequently.
This is so that the next time you or someone else makes a "small" change to the script, the bugs they have introduced can be caught quickly with the aid of the pragmas (without having to remember to put them back in).
Yeah, I know. We've heard it before. :) Now you've heard it again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strict, warnings and diagnostics pragmas
by tachyon (Chancellor) on Aug 03, 2001 at 18:32 UTC | |
|
Re: strict, warnings and diagnostics pragmas
by Hofmator (Curate) on Aug 03, 2001 at 17:30 UTC | |
by dragonchild (Archbishop) on Aug 03, 2001 at 17:37 UTC | |
by John M. Dlugosz (Monsignor) on Aug 03, 2001 at 20:54 UTC | |
by Hofmator (Curate) on Aug 07, 2001 at 17:00 UTC | |
by John M. Dlugosz (Monsignor) on Aug 07, 2001 at 19:50 UTC | |
|
Re: strict, warnings and diagnostics pragmas
by pmas (Hermit) on Aug 03, 2001 at 17:12 UTC | |
|
Re: strict, warnings and diagnostics pragmas
by xphase_work (Pilgrim) on Aug 03, 2001 at 18:03 UTC |