in reply to anyway to abbreviate use strict; use warnings;

The easy portable way for "warnings" is
#!/usr/bin/perl -w # on the first line of file (*NIX or Windows). # on a Unix type system, you need all but the -w anyway. # a Windows box will see the -w and use it. # I always recommend the usage of: # use strict;

"Strict" has a compile time penalty. "Warnings" has a run-time penalty (but not that much). Unless you are darn sure your program is working very well AND you need the extra performance, I would never turn "Warnings Off". Strict is a compile time option and very cheap. Always use that.

Replies are listed 'Best First'.
Re^2: anyway to abbreviate use strict; use warnings;
by ikegami (Patriarch) on Jan 11, 2009 at 08:26 UTC

    I've seen a number of benchmarks for warnings, and there never was a run-time penalty.

    Rate w=1 w=0 w=1 3003/ms -- -1% w=0 3032/ms 1% -- Rate w=1 w=0 w=1 3002/ms -- -0% w=0 3010/ms 0% --

    Benchmark code

    I'm curious as to why you said compile-time. Some strict checks are done at run-time. But again, there's no penalty for strict either.

    Rate sr=0 sr=1 sr=0 2751/ms -- -0% sr=1 2759/ms 0% -- Rate sr=1 sr=0 sr=1 2735/ms -- -1% sr=0 2754/ms 1% --

    Benchmark code