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

Re: Encoding WAS Re: Announcing Perl 7

Thread Previous | Thread Next
Dan Book
June 29, 2020 23:51
Re: Encoding WAS Re: Announcing Perl 7
Message ID:
On Mon, Jun 29, 2020 at 7:46 PM Felipe Gasper <>

> > On Jun 29, 2020, at 6:59 PM, Eric Brine <> wrote:
> >
> > Sawyer X speaks of making it easy to accept newcomers, and I think one
> of the biggest difficulties facing newcomers is dealing with encoding and
> decoding.
> I know seasoned Perl developers who struggle with Perl’s character
> encoding logic. Until embarrassingly-recently I was one of them, and I’m
> still a bit nervous to claim I now understand it.
> It *IS* fairly simple, I think, once the crucial pieces “click” mentally.
> But that “click” is, IMO, far from “default”. And, like reference-counting
> in C, it’s fiendishly easy to make a subtle mistake that may not manifest
> until you’re far removed from the context where the bug is.
> Perl’s “happy confusion” between character-vs.-byte strings is a stumbling
> block for so many. It aggravates the learning curve for newcomers and
> complicates IPC with other languages. If we could somehow have
> “introspectable” string types--strings that “know” whether they represent
> octets or characters--I think that would be a boon for everyone.

100% agreed. I plan to write a blog post at some point on how strings work
in Perl currently but a feature that allows one to declare explicit
intentions as magic attached to strings would be the beginnings of a very
useful system to help people who don't understand the setup or how one
should approach character encoding, and as you mentioned this is far from
just Perl newcomers.


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