Skip to content

The use source::encoding "ascii"; implied by use v5.42; only takes effect on the next line #23881

@ikegami

Description

@ikegami

According to the new source::encoding pragma's documentation,

use source::encoding 'ascii' is automatically enabled within the lexical scope of a use v5.41.0 or higher.

To me, this means that

use v5.42;

is equivalent to

use v5.42;
use source::encoding "ascii";

But that doesn't seem to be the case.

$ perl -e'use v5.42; my $x = "é";'

$ perl -e'use v5.42; use source::encoding "ascii"; my $x = "é";'
Use of non-ASCII character 0xC3 illegal when 'use source::encoding "ascii"' is in effect at -e line 1, near ""ascii";"
Execution of -e aborted due to compilation errors.

Code bug, documentation bug, or misunderstanding?

This is perl 5, version 42, subversion 0 (v5.42.0) built for x86_64-linux-thread-multi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions