Can 'use strict' warn instead of error

前端 未结 5 1156
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 04:31

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

5条回答
  •  孤城傲影
    2021-01-19 04:56

    No, use strict can't be made to issue warnings rather than die. All it does is set a few bits in the magic $^H variable, which triggers various things in the guts of the Perl interpreter.

    No, use warnings isn't warning about the same things as use strict kills you for. For instance, use warnings will warn you about variables used only once (which might be the result of typos).

提交回复
热议问题