| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# This file was autogenerated. |
|
2
|
2
|
|
|
2
|
|
227560
|
use 5.008001; |
|
|
2
|
|
|
|
|
14
|
|
|
3
|
2
|
|
|
2
|
|
14
|
use strict; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
38
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
54
|
|
|
5
|
2
|
|
|
2
|
|
11
|
no warnings qw( void once ); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
65
|
|
|
6
|
2
|
|
|
2
|
|
384
|
use Hydrogen (); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
120
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Hydrogen::Code; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
|
11
|
|
|
|
|
|
|
our $VERSION = '0.020000'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Hydrogen::Code - a standard library for code blocks |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This documentation is for Hydrogen::Code 0.020000, |
|
20
|
|
|
|
|
|
|
which is based on Sub::HandlesVia::HandlerLibrary::Code 0.046. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Each function expects a code block as its first argument. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The functions use prototypes, so you don't have to pass a reference. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
9
|
use Exporter::Shiny qw( |
|
33
|
|
|
|
|
|
|
execute |
|
34
|
|
|
|
|
|
|
execute_list |
|
35
|
|
|
|
|
|
|
execute_scalar |
|
36
|
|
|
|
|
|
|
execute_void |
|
37
|
2
|
|
|
2
|
|
12
|
); |
|
|
2
|
|
|
|
|
4
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 C<< execute { CODE } @args >> |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Calls the coderef, passing it any arguments. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub execute (&;@) { |
|
46
|
0
|
|
|
0
|
1
|
|
my $__REF__ = \$_[0]; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
package Hydrogen::Code::__SANDBOX__; |
|
49
|
0
|
|
|
|
|
|
$$__REF__->( @_[ 1 .. $#_ ] ); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 C<< execute_list { CODE } @args >> |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Calls the coderef, passing it any arguments, and forcing list context. If called in scalar context, returns an arrayref. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub execute_list (&;@) { |
|
59
|
0
|
|
|
0
|
1
|
|
my $__REF__ = \$_[0]; |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package Hydrogen::Code::__SANDBOX__; |
|
62
|
0
|
|
|
|
|
|
my @shv_list = $$__REF__->( @_[ 1 .. $#_ ] ); |
|
63
|
0
|
0
|
|
|
|
|
wantarray ? @shv_list : \@shv_list; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 C<< execute_scalar { CODE } @args >> |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Calls the coderef, passing it any arguments, and forcing scalar context. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub execute_scalar (&;@) { |
|
73
|
0
|
|
|
0
|
1
|
|
my $__REF__ = \$_[0]; |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
package Hydrogen::Code::__SANDBOX__; |
|
76
|
0
|
|
|
|
|
|
scalar( $$__REF__->( @_[ 1 .. $#_ ] ) ); |
|
77
|
|
|
|
|
|
|
} |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 C<< execute_void { CODE } @args >> |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Calls the coderef, passing it any arguments, and forcing void context. Returns undef. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub execute_void (&;@) { |
|
86
|
0
|
|
|
0
|
1
|
|
my $__REF__ = \$_[0]; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
package Hydrogen::Code::__SANDBOX__; |
|
89
|
0
|
|
|
|
|
|
$$__REF__->( @_[ 1 .. $#_ ] ); |
|
90
|
0
|
|
|
|
|
|
undef; |
|
91
|
|
|
|
|
|
|
} |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 EXPORT |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
No functions are exported by this module by default. To import them all (this is usually a bad idea), use: |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
use Hydrogen::Code -all; |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
To import a particular function, use: |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
use Hydrogen::Code 'execute_scalar'; |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
To rename functions: |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
use Hydrogen::Code 'execute_scalar' => { -as => 'myfunc' }; |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
On Perl 5.37.2+ (or if L is installed) you can import lexically: |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
use Hydrogen::Code -lexical, 'execute_scalar'; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
See L for more hints on importing. |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 BUGS |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Please report any bugs to |
|
118
|
|
|
|
|
|
|
L. |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
L, |
|
123
|
|
|
|
|
|
|
L, |
|
124
|
|
|
|
|
|
|
L, |
|
125
|
|
|
|
|
|
|
L, |
|
126
|
|
|
|
|
|
|
L. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 AUTHOR |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Toby Inkster Etobyink@cpan.orgE. |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This software is copyright (c) 2022-2023 by Toby Inkster. |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
137
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
|
142
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
|
143
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
|
144
|
|
|
|
|
|
|
|