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

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

Thread Previous | Thread Next
Felipe Gasper
August 16, 2021 12:50
Re: "use v5.36.0" should imply ASCII source
Message ID:

> On Aug 16, 2021, at 8:00 AM, Graham Knop <> wrote:
> After thinking about this again, I had another idea.
> The reason implying 'use utf8' is a problem is because of the impact
> it has on string semantics. Maybe we can just have it not impact
> string semantics. Make 'use v5.36.0;' decode the source as UTF-8, but
> store string literals as byte strings rather than characters. The
> strings would still be required to be UTF-8 encoded, but would be
> stored with the utf8 flag off. This would allow using UTF-8 encoded
> content in comments, Pod, or even in function names, but would not
> create the confusion with strings and IO.

I thought of this sometime back, but more in the context of adding flexibility to

    use utf8 decode => 'no_strings';    # What Graham envisions
    my $foo = "é";                      # 2 code points

    use utf8 decode => 'all';    # status quo
    my $foo = "é";               # 1 code point

I personally would think decode=no_strings could be added to the feature bundle with little trouble. The use case for leaving strings undecoded doesn’t seem to apply for things besides strings.

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