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

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)

Replies are listed 'Best First'.
Re^4: List vs array printing in perl
by ikegami (Patriarch) on Apr 01, 2016 at 15:48 UTC

    "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.

        I see. It's probably documented that way because 5.11 (and other odd version since 5.6) is a version put out for testing, not for use. Or maybe it didn't work in 5.11.0.
        when I set up my template, I wanted to specify the lowest possible version implying strict. Didn't think about non-stable vs. stable. (and the lowest I'm using effectively is 5.14, anyway)