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

[perl #128479] Assigning hashref to symtable not an error since(somewhere before 5.21.10 )

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
June 25, 2016 14:13
Subject:
[perl #128479] Assigning hashref to symtable not an error since(somewhere before 5.21.10 )
Message ID:
rt-4.0.18-28408-1466864030-1554.128479-15-0@perl.org
On Sat Jun 25 00:09:09 2016, kentfredric wrote:
> This is a bug report for perl from kentnl@cpan.org
> generated with the help of perlbug 1.40 running under perl 5.25.1.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> Only managed to narrow it happening between 5.20.0 and 5.21.10
> somewhere
> as all the perl's I have inbetween broke (libraries went away)
> 
> On 5.20.0, the following code is illegal and dies with "Cannot convert
> a reference to HASH to typeglob at /tmp/wtf.pl line 13."
> 
> <--->
> #!perl
> use strict;
> use warnings;
> 
> BEGIN {
>   my $namespace = do {
>     no strict 'refs';
>     \%{ 'Foo::' };
>   };
>   $namespace->{bar} = { "key" => "value" };
> }
> 
> print ref Foo::bar() || 'nothing';
> 
> <--->
> 
> 
> On 5.21.10+ , Foo::bar() silently returns undef.

The changes in how subroutines are stored in stashes are probably responsible.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=128479

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About