File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,34 @@ here, but most should go in the L</Performance Enhancements> section.
27
27
28
28
[ List each enhancement as a =head2 entry ]
29
29
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
+
30
58
=head1 Security
31
59
32
60
XXX Any security-related notices go here. In particular, any security
You can’t perform that action at this time.
0 commit comments