line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This file was autogenerated. |
2
|
3
|
|
|
3
|
|
227466
|
use 5.008001; |
|
3
|
|
|
|
|
15
|
|
3
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
61
|
|
4
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
86
|
|
5
|
3
|
|
|
3
|
|
14
|
no warnings qw( void once ); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
106
|
|
6
|
3
|
|
|
3
|
|
412
|
use Hydrogen (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
167
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Hydrogen::Bool; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
11
|
|
|
|
|
|
|
our $VERSION = '0.018'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Hydrogen::Bool - a standard library for booleans |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This documentation is for Hydrogen::Bool 0.018, |
20
|
|
|
|
|
|
|
which is based on Sub::HandlesVia::HandlerLibrary::Bool 0.046. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 FUNCTIONS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Each function expects a scalar which will be treated as a boolean as its first argument. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
14
|
use Exporter::Shiny qw( |
31
|
|
|
|
|
|
|
not |
32
|
|
|
|
|
|
|
reset |
33
|
|
|
|
|
|
|
set |
34
|
|
|
|
|
|
|
toggle |
35
|
|
|
|
|
|
|
unset |
36
|
3
|
|
|
3
|
|
19
|
); |
|
3
|
|
|
|
|
5
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 C<< not( $bool ) >> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Returns the opposite value of the boolean. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub not { |
45
|
1
|
|
|
1
|
1
|
7343
|
my $__REF__ = \$_[0]; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
package Hydrogen::Bool::__SANDBOX__; |
48
|
1
|
50
|
|
|
|
5
|
@_ == 1 |
49
|
|
|
|
|
|
|
or Hydrogen::croak( "Wrong number of parameters for not; usage: " |
50
|
|
|
|
|
|
|
. "Hydrogen::Bool::not( \$bool )" ); |
51
|
1
|
|
|
|
|
6
|
!$$__REF__; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 C<< reset( $bool ) >> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Sets the boolean to its default value, or false if it has no default. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub reset { |
61
|
0
|
|
|
0
|
1
|
0
|
my $__REF__ = \$_[0]; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
package Hydrogen::Bool::__SANDBOX__; |
64
|
0
|
0
|
|
|
|
0
|
@_ == 1 |
65
|
|
|
|
|
|
|
or Hydrogen::croak( "Wrong number of parameters for reset; usage: " |
66
|
|
|
|
|
|
|
. "Hydrogen::Bool::reset( \$bool )" ); |
67
|
0
|
|
|
|
|
0
|
( ${$__REF__} = !!0 ); |
|
0
|
|
|
|
|
0
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 C<< set( $bool ) >> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Sets the value of the boolean to true. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub set { |
77
|
1
|
|
|
1
|
1
|
5158
|
my $__REF__ = \$_[0]; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
package Hydrogen::Bool::__SANDBOX__; |
80
|
1
|
50
|
|
|
|
6
|
@_ == 1 |
81
|
|
|
|
|
|
|
or Hydrogen::croak( "Wrong number of parameters for set; usage: " |
82
|
|
|
|
|
|
|
. "Hydrogen::Bool::set( \$bool )" ); |
83
|
1
|
|
|
|
|
2
|
( ${$__REF__} = !!1 ); |
|
1
|
|
|
|
|
2
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 C<< toggle( $bool ) >> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Toggles the truth value of the boolean. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub toggle { |
93
|
2
|
|
|
2
|
1
|
2889
|
my $__REF__ = \$_[0]; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package Hydrogen::Bool::__SANDBOX__; |
96
|
2
|
50
|
|
|
|
8
|
@_ == 1 |
97
|
|
|
|
|
|
|
or Hydrogen::croak( "Wrong number of parameters for toggle; usage: " |
98
|
|
|
|
|
|
|
. "Hydrogen::Bool::toggle( \$bool )" ); |
99
|
2
|
|
|
|
|
5
|
( ${$__REF__} = !$$__REF__ ); |
|
2
|
|
|
|
|
4
|
|
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 C<< unset( $bool ) >> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Sets the value of the boolean to false. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub unset { |
109
|
1
|
|
|
1
|
1
|
2769
|
my $__REF__ = \$_[0]; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
package Hydrogen::Bool::__SANDBOX__; |
112
|
1
|
50
|
|
|
|
4
|
@_ == 1 |
113
|
|
|
|
|
|
|
or Hydrogen::croak( "Wrong number of parameters for unset; usage: " |
114
|
|
|
|
|
|
|
. "Hydrogen::Bool::unset( \$bool )" ); |
115
|
1
|
|
|
|
|
2
|
( ${$__REF__} = !!0 ); |
|
1
|
|
|
|
|
3
|
|
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 EXPORT |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
No functions are exported by this module by default. To import them all (this is usually a bad idea), use: |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
use Hydrogen::Bool -all; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
To import a particular function, use: |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
use Hydrogen::Bool 'set'; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
To rename functions: |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
use Hydrogen::Bool 'set' => { -as => 'myfunc' }; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
On Perl 5.37.2+, you can import lexically: |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
use Hydrogen::Bool -lexical, 'set'; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
See L for more hints on importing. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 BUGS |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Please report any bugs to |
143
|
|
|
|
|
|
|
L. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 SEE ALSO |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
L, |
148
|
|
|
|
|
|
|
L, |
149
|
|
|
|
|
|
|
L, |
150
|
|
|
|
|
|
|
L. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 AUTHOR |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Toby Inkster Etobyink@cpan.orgE. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Toby Inkster. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
161
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
166
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
167
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
168
|
|
|
|
|
|
|
|