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

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

Thread Previous | Thread Next
Karl Williamson
August 7, 2021 17:44
Re: "use v5.36.0" should imply ASCII source
Message ID:
On 8/7/21 11:12 AM, Karl Williamson wrote:
> On 8/7/21 5:53 AM, Dave Mitchell wrote:
>> 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?
> Pod is currently assumed to be CP1252 or UTF-8 unless an =encoding line 
> is specified

More specifically.  Pod::Simple doesn't require you to use an =encoding 
line.  If a non-ASCII character is found, it will automatically insert 
either a cp1252 or utf8 line for you.

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