Skip to content

Commit 883bf45

Browse files
committed
perldelta for new :writer field attribute
1 parent 2bb873b commit 883bf45

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pod/perldelta.pod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ 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<:writer> attribute on field variables
31+
32+
Classes defined using C<use feature 'class'> are now able to automatically
33+
create writer accessors for scalar fields, by using the C<:writer> attribute,
34+
similar to the way that C<:reader> already creates reader accessors.
35+
36+
class Point {
37+
field $x :reader :writer :param;
38+
field $y :reader :writer :param;
39+
}
40+
41+
my $p = Point->new( x => 20, y => 40 );
42+
$p->set_x(60);
43+
3044
=head1 Security
3145

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

0 commit comments

Comments
 (0)