When using use strict
perl will generate a runtime error on unsafe constructs. Now I am wondering if it is possible to have it only print a warning instead of c
The warnings
and strict
pragmas are complementary, not overlapping. The strict
pragma has both compile-time and run-time effects. You can't reduce the severity of strictures from errors to warnings, but you can disable them entirely. For example, if you're writing your own export routine you'll need to enable symbolic references in order to manipulate the symbol table.
{
no strict 'refs';
# symrefs okay within this block
}
Warnings can also be disabled lexically (assuming you did use warnings
instead of the largely obsolete -w
flag).
Strictures and warnings provide a safety net. That's why they're recommended to be used by default. If you disable them you should disable only what's necessary and limit the change to the smallest possible scope.