Skip to content

Commit 8cf9e0b

Browse files
committed
Perldelta for new 'class' feature
1 parent 744456c commit 8cf9e0b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

pod/perldelta.pod

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,34 @@ 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> Feature
31+
32+
A new B<experimental> syntax is now available for defining object classes,
33+
where per-instance data is stored in "field" variables that behave like
34+
lexicals.
35+
36+
use feature 'class';
37+
38+
class Point
39+
{
40+
field $x;
41+
field $y;
42+
43+
method zero { $x = $y = 0; }
44+
}
45+
46+
This is described in more detail in L<perlclass>. Notes on the internals of
47+
its implementation and other related details can be found in L<perlclassguts>.
48+
49+
This remains a new and experimental feature, and is very much still under
50+
development. It will be the subject of much further addition, refinement and
51+
alteration in future releases. As it is experimental, it yields warnings in
52+
the C<experimental::class> category. These can be silenced by a
53+
C<no warnings> statement.
54+
55+
use feature 'class';
56+
no warnings 'experimental::class';
57+
3058
=head1 Security
3159

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

0 commit comments

Comments
 (0)