in reply to Why isn't C<use strict> the default?

perl -lne 'END{print$x}$x+=$_'

Perl one liners are nice. Don't forget that, although perl is also an awesome fully-featured programming language, it's roots are as a command-line data-processing tool (ala sed, awk and even grep). Who wants to spend those extra characters in a -e?

Don't get me wrong, I like strict in anything more than a few lines long, but I also write a lot of stuff that's less than a few lines long.

------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re^2: Why isn't C<use strict> the default?
by demerphq (Chancellor) on Oct 28, 2004 at 08:30 UTC

    This argument doesn't addresss the fact that one could arrange it so perl would turn on strict and warnings for code from any other source than -e but leave -e code unencumbered.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi

      Flux8


      Or you could have another name for the binary that makes perl assume use strict; (and maybe warnings also)…

      #!/usr/bin/perls no swine;

      Makeshifts last the longest.