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

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

Thread Previous | Thread Next
From:
Dan Book
Date:
August 12, 2021 15:09
Subject:
Re: "use v5.36.0" should imply ASCII source
Message ID:
CABMkAVVUb0U_ptHKwu2XPzbXO8SVhvnBT5ok=Dh8Hs6dvE4KYQ@mail.gmail.com
On Thu, Aug 12, 2021 at 11:04 AM David Cantrell <david@cantrell.org.uk>
wrote:

> On Fri, Aug 06, 2021 at 11:45:21PM -0700, Darren Duncan wrote:
> > On 2021-08-06 5:01 p.m., Chris Prather wrote:
> > >>On Aug 6, 2021, at 2:58 PM, Dan Book <grinnz@gmail.com> wrote:
> > >>
> > >>I don't think it's comparable. Comments are parsed by the perl
> > >>interpreter, but POD is not, except to find the end of the POD.
> > >
> > >Additionally comments don???t as far as I know have a way to declare
> their
> > >encoding.
> > Question:  Is there ever a real life scenario where a single source file
> is
> > not entirely the same encoding?
>
> Sure. Some code, in utf8, and then a binary blob in __DATA__ which the
> utf8 code reads and parses.
>
> It's not good practice, but it's what you had to do to easily distribute
> data in a CPAN distribution before File::ShareDir::Install existed.
>

Note this will currently break because the filehandle *is* shared between
code and DATA, unlike with POD. "use utf8" applies to both. But I would
consider the use case of non-textual data in DATA exceedingly rare.

-Dan

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