Last active
December 3, 2025 04:23
-
-
Save hkoba/68ed343feb815ff125049453c685fb2d to your computer and use it in GitHub Desktop.
Stash entry type ambiguity in perl5.43.2-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Test2::V0 -no_srand => 1; | |
| { | |
| package | |
| MyTestPackage001; | |
| sub foo {"foo"} | |
| } | |
| { | |
| my $stash = \%MyTestPackage001::; | |
| is ref $stash->{foo}, '' | |
| , q{ref $MyTestPackage001::{foo} is not a ref}; | |
| is ref \$stash->{foo}, 'GLOB' | |
| , q{ref $MyTestPackage001::{foo} should be GLOB}; | |
| } | |
| eval q{ | |
| my $stash = \%MyTestPackage001::; | |
| is $stash->{foo}, *MyTestPackage001::foo, "touch the glob"; | |
| is ref $stash->{foo}, '' | |
| , q{ref $MyTestPackage001::{foo} is not a ref}; | |
| is ref \$stash->{foo}, 'GLOB' | |
| , q{ref $MyTestPackage001::{foo} should be GLOB}; | |
| }; | |
| done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment