Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extend examples for "CX::Done can be caught inside CONTROL phaser"
  • Loading branch information
lukasvalle committed Jun 12, 2019
1 parent 09b84e6 commit 988a9df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/Language/phasers.pod6
Expand Up @@ -396,20 +396,23 @@ Runs when an exception is raised by the current block, before the LEAVE phase.
=head2 X<CONTROL|Phasers, CONTROL>
Runs when a control exception is raised by the current block, before the LEAVE
phase. It is raised by C<return>, C<fail>, C<redo>, C<next>, C<last>, C<emit>,
phase. It is raised by C<return>, C<fail>, C<redo>, C<next>, C<last>, C<done>, C<emit>,
C<take>, C<warn>, C<proceed> and C<succeed>.
say elems gather {
CONTROL {
when CX::Warn { say "WARNING!!! $_"; .resume }
when CX::Take { say "Don't take my stuff"; .resume }
when CX::Done { say "Done"; .resume }
}
warn 'people take stuff here';
take 'keys';
done;
}
# OUTPUT:
# WARNING!!! people take stuff here
# Don't take my stuff
# Done
# 0
Expand Down

0 comments on commit 988a9df

Please sign in to comment.