#!/usr/bin/perl use strict; use warnings;
You should always use them as they are a safety net helping reduce mistakes.
It is usually very hard to add this safety net after you already have some code.
If the warnings you get don't make sense add
use diagnostics;
line and you will get more verbose warnings.
Why are use warnings and use strict so important even in small (< 100 lines) scripts ?
Helps avoiding trouble with recoursive functions
Helps avoiding typos in variable names
Disables unintentional symbolic references
Reduces debugging time
Enables/enforces better coding standard => cleaner code, maintainability
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Environment | Up | Comments |