line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Unixish::Util; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2019-10-26'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '1.572'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
44
|
|
|
44
|
|
703
|
use strict; |
|
44
|
|
|
|
|
82
|
|
|
44
|
|
|
|
|
1116
|
|
7
|
44
|
|
|
44
|
|
207
|
use warnings; |
|
44
|
|
|
|
|
83
|
|
|
44
|
|
|
|
|
8408
|
|
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
|
80
|
my $hash = shift; |
29
|
2
|
|
|
|
|
9
|
return { map {$_=>$hash->{$_}} grep {/\A\w+\z/} keys %$hash }; |
|
4
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
22
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
# ABSTRACT: Utility routines |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |