develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #119957] %CORE:: not filled with builtins

From:
Father Chrysostomos via RT
Date:
September 28, 2013 13:29
Subject:
[perl #119957] %CORE:: not filled with builtins
Message ID:
rt-3.6.HEAD-31239-1380374955-259.119957-15-0@perl.org
On Mon Sep 23 01:32:35 2013, mauke- wrote:
> 
> This is a bug report for perl from l.mai@web.de,
> generated with the help of perlbug 1.39 running under perl 5.18.1.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> % perl -wE 'my $x = "lc"; say *{"CORE::$x"}{CODE}->("ASDF")'
> asdf
> 
> % perl -wE 'my $x = "lc"; say *{$CORE::{$x}}{CODE}->("ASDF")'
> Can't use an undefined value as a symbol reference at -e line 1.
> 
> I can access builtins as CORE::foo, even at runtime using symbolic
>    references.
> But $CORE::{foo} doesn't work because %CORE:: is (almost) empty.
> 
> Wouldn't it make sense to support access via %CORE:: too?

For efficiency, perl does not bother creating all built-in variables at
startup.  You will also find $::{'$'} empty.  Coresubs do the same thing.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119957



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