From: Father Chrysostomos Date: Sun, 14 Aug 2011 20:42:27 +0000 (-0700) Subject: perldelta for &CORE::foo X-Git-Tag: accepted/trunk/20130322.191538~3148^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0afed34d529b803badb410b5b71e9fb2b1d479ca;p=platform%2Fupstream%2Fperl.git perldelta for &CORE::foo --- 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