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