Skip to content

builtin::reftype string comparison provides incorrect warning #19273

@mbeijen

Description

@mbeijen

Steps to Reproduce
Please note how builtin::reftype reports that the scalar $i is uninitialized, where it is not! Scalar::Util::reftypes error message is correct.

$ perl -Mv5.35 -MScalar::Util -E 'my $i = 1; builtin::reftype($i) eq "HASH"; Scalar::Util::reftype($i) eq "HASH"'
..
Use of uninitialized value $i in string eq at -e line 1.
Use of uninitialized value in string eq at -e line 1.

Expected behavior
I would expect the same warning as provided by Scalar::Reftype.

Perl configuration
Standard blead on x64 linux.

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