develooper Front page | perl.perl5.porters | Postings from August 2021

Re: "use v5.36.0" should imply ASCII source

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
August 7, 2021 11:53
Subject:
Re: "use v5.36.0" should imply ASCII source
Message ID:
YQ50I92i7Q8CxZHx@iabyn.com
On Fri, Aug 06, 2021 at 11:45:21PM -0700, Darren Duncan wrote:
> Question:  Is there ever a real life scenario where a single source file is
> not entirely the same encoding?  Can you reasonably have a single file
> containing Perl code and POD where the Perl code is one character encoding
> and the POD is another one? -- Darren Duncan

Mixed utf8/non-utf8 my be rare, but even fully utf8 source files will
still require 2 separate declarations:

a 'use utf8' for the perl parser, and a '=encoding utf8' for a pod parser,
which won't see or understand the 'use utf8'.

More generally, I think croaking on non-ascii in the src file is a fine
use for 'use v5.36'. I'm less clear whether it croak on pod too. Perhaps it
should croak on ord() > 0x7f in a pod section unless an '=encoding' has
been seen?



-- 
Little fly, thy summer's play my thoughtless hand
has terminated with extreme prejudice.
        (with apologies to William Blake)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About