Skip to content

Commit 8ca1c63

Browse files
committed
Show how to go from signal numbers to Signal objects to use with the signal method
1 parent d3f3d0c commit 8ca1c63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/Type/Supply.pod6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ the supply. For example:
601601
602602
would catch Control-C, thank you, and then exit. The list of supported
603603
signals can be found by checking Signal::.keys (as you would any enum).
604+
To go from a signal number to Signal, you can do something like this:
605+
606+
signal(Signal(2)).tap( -> $sig { say "Received signal: $sig" } );
604607
605608
=head2 method IO::Notification.watch-path
606609

0 commit comments

Comments
 (0)