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

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

Thread Previous | Thread Next
From:
Konovalov, Vadim
Date:
August 17, 2021 10:13
Subject:
RE: "use v5.36.0" should imply ASCII source
Message ID:
DM5PR1901MB219954E9DBA50BD8C93646878AFE9@DM5PR1901MB2199.namprd19.prod.outlook.com
From: David Cantrell

> On Thu, Aug 12, 2021 at 11:08:48AM -0400, Dan Book wrote:
> > On Thu, Aug 12, 2021 at 11:04 AM David Cantrell 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?
> > > 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.
> 
> I stopped doing it a few years ago. I think I've seen it in test suites for
> some image-processing modules in the past.

My use-case of binary __DATA__ was that I was uncompressing Compress::Zlib
data and used this in production in some 5.8.8 age, which was rather nice
to my taste.

not using this technique anymore, though.

Internal Use - Confidential

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