develooper Front page | perl.perl5.porters | Postings from June 2020

Re: Announcing Perl 7

Thread Previous | Thread Next
Sam Kington
June 27, 2020 21:43
Re: Announcing Perl 7
Message ID:
On 26 Jun 2020, at 17:03, Dave Mitchell <> wrote:
> On Fri, Jun 26, 2020 at 05:50:39PM +0200, demerphq wrote:
>> Ok, so just to be clear, my understanding that "use strict" and "no
>> strict" will be equivalent to "use perl-5-semantics; use strict;" and
>> "use perl-5-semantics; no strict;".
> I can't understand your obsession with just 'strict'.
> My understanding is that out-of-the-box, a perl7 binary will enable by
> default,  *a whole bunch of extra stuff*, not just 'strict'.
> So for example,  running a plain perl script using a perl7 interpreter is
> as if the following lines had been injected at the top of the script:
>    use warnings;
>    use strict;
>    use feature 'signatures';
>    no feature 'indirect';
>    ... etc ...
> is that the same as your understanding?

I thought the point was that if perl7 sees “use strict” but not “use v7”, it assumes “this is perl5 code”? Because “use strict” is a very, very common thing for perl5 code to say?

So if you say

 use v7;
 use CPAN::Module;

 my $input;
 { local $/ = undef; $input = <>; }
 my $thing = CPAN::Module->parse($input);

then you get Unicode strings etc. in *this* file; but because CPAN::Module says “use strict” somewhere, and not “use v7”, it’s still considered to be perl5 code, so doesn’t have warnings, unicode strings etc. turned on?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About