in reply to Re^2: Why isn't C<use strict> the default?
in thread Why isn't C<use strict> the default?

These are lines that get typed in 99% of the stuff I write (unless there's a good reason not to) and if nothing else, hey, it'll save on finger strain.
I always use strict for programs that are not of the -e type, and I'm a lazy typist. My solution was to tell my text editor (vim, but you can surely do something similar with others) to read from a template file whenever I try to edit a non-existent file ending on .pl. The template file includes the shebang line, use strict and use warnings. I also have a template file for *.pm with a little bit more stuff.
  • Comment on Re^3: Why isn't C<use strict> the default?

Replies are listed 'Best First'.
Re^4: Why isn't C<use strict> the default?
by skillet-thief (Friar) on Oct 28, 2004 at 15:01 UTC

    Since you mention it, here's a snippet from my .emacs file.

    (add-hook 'cperl-mode-hook '(lambda () (define-skeleton perl-start "skeleton for a perl program" "" "#!/usr/local/bin/perl\nuse strict;\nuse warnings;" ) (local-set-key [(control c) ($)] 'perl-start) ))
Re^4: Why isn't C<use strict> the default?
by BrowserUk (Patriarch) on Oct 28, 2004 at 13:34 UTC

    I do a similar thing in my editor also, but the problem is not us that know enough to decide that's what we want, but those that are just starting out and don't.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon