Skip to content

Commit e139fae

Browse files
committed
Perldelta for new __CLASS__ keyword
1 parent 63119cc commit e139fae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pod/perldelta.pod

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ here, but most should go in the L</Performance Enhancements> section.
2727

2828
[ List each enhancement as a =head2 entry ]
2929

30+
=head2 New C<__CLASS__> Keyword
31+
32+
When using the new C<class> feature, code inside a method, C<ADJUST> block or
33+
field initializer expression is now permitted to use the new C<__CLASS__>
34+
keyword. This yields a class name, similar to C<__PACKAGE__>, but whereas that
35+
gives the compile-time package that the code appears in, the C<__CLASS__>
36+
keyword is aware of the actual run-time class that the object instance is a
37+
member of. This makes it useful for method dispatch on that class, especially
38+
during constructors, where access to C<$self> is not permitted.
39+
40+
For more information, see L<perlfunc/__CLASS__>.
41+
3042
=head1 Security
3143

3244
XXX Any security-related notices go here. In particular, any security

0 commit comments

Comments
 (0)