From e1be69698cd12df3e82733401835326156431534 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 2 Aug 2023 13:39:11 +0100 Subject: [PATCH] Perldelta for new __CLASS__ keyword --- pod/perldelta.pod | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 98ba752e73f1..9afcee8b1e1f 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -27,6 +27,18 @@ here, but most should go in the L section. [ List each enhancement as a =head2 entry ] +=head2 New C<__CLASS__> Keyword + +When using the new C feature, code inside a method, C block or +field initializer expression is now permitted to use the new C<__CLASS__> +keyword. This yields a class name, similar to C<__PACKAGE__>, but whereas that +gives the compile-time package that the code appears in, the C<__CLASS__> +keyword is aware of the actual run-time class that the object instance is a +member of. This makes it useful for method dispatch on that class, especially +during constructors, where access to C<$self> is not permitted. + +For more information, see L. + =head1 Security XXX Any security-related notices go here. In particular, any security