From 0afed34d529b803badb410b5b71e9fb2b1d479ca Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 14 Aug 2011 13:42:27 -0700 Subject: [PATCH] perldelta for &CORE::foo --- pod/perldelta.pod | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 6118cd4..0d87c3a 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -28,6 +28,21 @@ here, but most should go in the L section. [ List each enhancement as a =head2 entry ] +=head2 Subroutines in the CORE namespace + +Many Perl keywords are now available as subroutines in the CORE namespace. +These cannot be called through references or via C<&foo> syntax yet, but +must be called as barewords. In other words, you can now do this: + + BEGIN { *entangle = \&CORE::tie } + entangle $variable, $package, @args; + +This currently works for overridable keywords other than C, C, +C and the infix operators. + +Work is under way to allow these subroutines to be called through +references. + =head2 C<__FILE__()> Syntax The C<__FILE__>, C<__LINE__> and C<__PACKAGE__> tokens can now be written @@ -279,7 +294,15 @@ XXX Newly added diagnostic messages go here =item * -XXX L +L<&CORE::%s cannot be called directly|perldiag/"&CORE::%s cannot be called directly"> + +(F) You tried to call a subroutine in the C namespace +with C<&foo> syntax or through a reference. The subroutines +in this package cannot yet be called that way, but must be +called as barewords. Something like this will work: + + BEGIN { *shove = \&CORE::push; } + shove @array, 1,2,3; # pushes on to @array =back -- 2.7.4