| 1 | package Data::Unixish::Util; | ||
| 2 | |||
| 3 | 89 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 89 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 89 | ▶ | use Exporter qw(import); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 89 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 9 | 89 | our $DATE = '2025-02-24'; # DATE | |
| 10 | 89 | our $DIST = 'Data-Unixish'; # DIST | |
| 11 | 89 | our $VERSION = '1.574'; # VERSION | |
| 12 | |||
| 13 | 89 | our @EXPORT_OK = qw(%common_args filter_args); | |
| 14 | |||
| 15 | 89 | our %common_args = ( | |
| 16 | in => { | ||
| 17 | summary => 'Input stream (e.g. array or filehandle)', | ||
| 18 | schema => ['array'], | ||
| 19 | #cmdline_src => 'stdin_or_files', # not until pericmd-base supports streaming | ||
| 20 | #stream => 1, | ||
| 21 | }, | ||
| 22 | out => { | ||
| 23 | summary => 'Output stream (e.g. array or filehandle)', | ||
| 24 | schema => 'any', # TODO: any* => of => [stream*, array*] | ||
| 25 | #req => 1, | ||
| 26 | }, | ||
| 27 | ); | ||
| 28 | |||
| 29 | 2 | ▶ | sub filter_args { |
|
Subroutine
filter_args: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 2 | my $hash = shift; | |
| 31 | 2 | return { map {$_=>$hash->{$_}} grep {/\A\w+\z/} keys %$hash }; | |
| 32 | } | ||
| 33 | |||
| 34 | 89 | 1; | |
| 35 | # ABSTRACT: Utility routines | ||
| 36 | |||
| 37 | __END__ | ||