in reply to Re: Making strict optional
in thread Making strict optional
While that trick can be used for detecting if strict exists, it won't turn strict on.
strict ends here | | BEGIN { v eval 'use strict'; warn("Cannot 'use strict', it appears to be missing\n") if $@; }
On the other hand, the following works (and doesn't use eval EXPR):
BEGIN { eval { require strict }; if ($@) { warn("Cannot 'use strict', it appears to be missing\n"); } else { strict->import(); } }
|
|---|