Perl: the Markov chain saw | |
PerlMonks |
Re: -w in production environmentby tachyon (Chancellor) |
on Jul 05, 2001 at 23:21 UTC ( [id://94212]=note: print w/replies, xml ) | Need Help?? |
Eliminating -w is one option that will work and is reasonable if you have completely debugged all the code...If you find a reliable method please tell me how! Another option is to initialise all your values. It depends on how your script is structured as to how you do this. Say you are using CGI.pm, here is what you usually find at the top of my scripts:
If you use param queries directly you can do this to define all undefined values:
This iterates over the field names an pushes a null string into the value if it is not defined. You can use the same method for a hash:
Use strict does have an overhead (a very small overhead) - try benchmarking if you are really worried and execution speed is everything. Use mod perl in this case! The reason for leaving use strict and -w active is that your code *will* be modified one day, perhaps by you, perhaps not. If they are active no one has to to remember to reactivate them. If you must kill them comment them out rather than erase them entirely with a note that the should be used for testing modifications to the code. cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In Section
Seekers of Perl Wisdom
|
|