in reply to Re: List vs array printing in perl
in thread List vs array printing in perl

Always use strictures (use strict; use warnings; - see The strictures, according to Seuss).

:-D

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^3: List vs array printing in perl
by soonix (Chancellor) on Mar 31, 2016 at 09:25 UTC
    my script template begins with
    use 5.011; # implies strict + feature 'say' use warnings;
    but that doesn't help with a one-liner. There he could use
    perl -wMstrict -e ...
    (that goes without saying, though)

      "Similarly, if the specified Perl version is greater than or equal to 5.12.0, strictures are enabled lexically as with use strict . "

      According to the documentation, you need use 5.012;.

        The docs may be right, but 5.011 works for me (on 5.20):

        $ cat xxx.pl #!/usr/bin/env perl use 5.011; use warnings; $x = 1; $ ./xxx.pl Global symbol "$x" requires explicit package name at ./xxx.pl line 5. Execution of ./xxx.pl aborted due to compilation errors.

        That said, I see no great advantage to having a non-stable-release version as the minimum requirement, especially such an old one. YMMV.