Sidef/Sys/Sig.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Sidef::Sys::Sig;
2  
3 use utf8;
4 use 5.016;
5  
6 sub new {
7 bless {}, __PACKAGE__;
8 }
9  
10 {
11 no strict 'refs';
12 foreach my $key (keys(%SIG), '__WARN__', '__DIE__') {
13 *{__PACKAGE__ . '::' . $key} = sub {
14 my (undef, $signal) = @_;
15  
16 if (ref $signal) {
17 return $SIG{$key} = $signal->get_value;
18 }
19  
20 $SIG{$key};
21 };
22 }
23 }
24  
25 1