line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Unixish::Util; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2019-01-06'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '1.570'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
40
|
|
|
40
|
|
695
|
use strict; |
|
40
|
|
|
|
|
92
|
|
|
40
|
|
|
|
|
1042
|
|
7
|
40
|
|
|
40
|
|
181
|
use warnings; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
7711
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw(%common_args filter_args); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %common_args = ( |
14
|
|
|
|
|
|
|
in => { |
15
|
|
|
|
|
|
|
summary => 'Input stream (e.g. array or filehandle)', |
16
|
|
|
|
|
|
|
schema => ['array'], |
17
|
|
|
|
|
|
|
#cmdline_src => 'stdin_or_files', # not until pericmd-base supports streaming |
18
|
|
|
|
|
|
|
#stream => 1, |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
out => { |
21
|
|
|
|
|
|
|
summary => 'Output stream (e.g. array or filehandle)', |
22
|
|
|
|
|
|
|
schema => 'any', # TODO: any* => of => [stream*, array*] |
23
|
|
|
|
|
|
|
#req => 1, |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub filter_args { |
28
|
2
|
|
|
2
|
1
|
86
|
my $hash = shift; |
29
|
2
|
|
|
|
|
9
|
return { map {$_=>$hash->{$_}} grep {/\A\w+\z/} keys %$hash }; |
|
4
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
20
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
# ABSTRACT: Utility routines |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |