stable.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 SCAR 24.8
CC
3
Cov
0%
import
12.0
unimport
2.0
BEGIN
2.0
CRAP 12.0
1 package stable;
2 $stable::VERSION = '0.031';
3 use strict;
4 use warnings;
5 use version ();
6  
7 use experimental ();
8 use Carp qw/croak carp/;
9  
10 my %allow_at = (
11 bitwise => 5.022000,
12 isa => 5.032000,
13 lexical_subs => 5.022000,
14 postderef => 5.020000,
15 );
16  
17 sub import {
18 my ($self, @pragmas) = @_;
19  
20 for my $pragma (@pragmas) {
21 my $min_ver = $allow_at{$pragma};
22 croak "unknown stablized experiment $pragma" unless defined $min_ver;
23 croak "requested stablized experiment $pragma, which is stable at $min_ver but this is $]"
24 unless $] >= $min_ver;
25 }
26  
27 experimental->import(@pragmas);
28 return;
29 }
30  
31 sub unimport {
32 my ($self, @pragmas) = @_;
33  
34 # Look, we could say "You can't unimport stable experiment 'bitwise' on
35 # 5.20" but it just seems weird. -- rjbs, 2022-03-05
36 experimental->unimport(@pragmas);
37 return;
38 }
39  
40 1;
41  
42 #ABSTRACT: Experimental features made easy, once we know they're stable
43  
44 __END__