Skip to content

Commit 0d54f02

Browse files
author
Carl Mäsak
authored
Document that Failure.handled is an lvalue
Something I learned today as part of code review. Thought it might be useful in the documentation.
1 parent e309ddd commit 0d54f02

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/Type/Failure.pod6

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ Returns C<True> for handled failures, C<False> otherwise.
3434
3535
sub f() { fail }; my $v = f; say $v.handled; # OUTPUT: «False␤»
3636
37+
The C<handled> method is an lvalue, which means you can also use it to set the
38+
handled state:
39+
40+
sub f() { fail }
41+
my $v = f;
42+
$v.handled = True;
43+
say $v.handled; # OUTPUT: «True␤»
44+
3745
=head2 method exception
3846
3947
Defined as:

0 commit comments

Comments
 (0)