view release on metacpan or search on metacpan
0.002 2024-02-24 Released-By: PERLANCAR; Urgency: medium
- [incompatible change] Ingredient and weight fields now must match
between CSV files.
- All extra fields from all individual formula CSVs will be shown in the
final mixed formula CSV.
- Add option: --ingredient-field, --weight-field to allow specifying
which field to contain ingredient and weight.
0.001 2024-02-24 Released-By: PERLANCAR
- First release.
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.031.
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/App/CSVUtils/csv_mix_formulas.pm
script/csv-mix-formulas
t/00-compile.t
t/author-critic.t
t/author-pod-coverage.t
t/author-pod-syntax.t
t/release-rinci.t
weaver.ini
{
"abstract" : "Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula",
"author" : [
"perlancar <perlancar@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.031, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "App-CSVUtils-csv_mix_formulas",
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
"requires" : {
"Pod::Coverage::TrustPod" : "0",
"Test::Perl::Critic" : "0",
"test" : {
"requires" : {
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::More" : "0"
}
}
},
"provides" : {
"App::CSVUtils::csv_mix_formulas" : {
"file" : "lib/App/CSVUtils/csv_mix_formulas.pm",
"version" : "0.002"
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=App-CSVUtils-csv_mix_formulas"
},
"homepage" : "https://metacpan.org/release/App-CSVUtils-csv_mix_formulas",
"repository" : {
"type" : "git",
"url" : "git://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas.git",
"web" : "https://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas"
}
},
"version" : "0.002",
"x_Dist_Zilla" : {
"perl" : {
"version" : "5.038002"
},
"plugins" : [
{
"class" : "Dist::Zilla::Plugin::GenPericmdScript",
"name" : "GenPericmdScript csv-mix-formulas",
"version" : "0.425"
},
{
"class" : "Dist::Zilla::Plugin::InsertExecsList",
"name" : "InsertExecsList",
"version" : "0.032"
},
{
"class" : "Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease",
"name" : "@Author::PERLANCAR/PERLANCAR::CheckPendingRelease",
---
abstract: 'Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula'
author:
- 'perlancar <perlancar@cpan.org>'
build_requires:
File::Spec: '0'
IO::Handle: '0'
IPC::Open3: '0'
Test::More: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.031, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: App-CSVUtils-csv_mix_formulas
provides:
App::CSVUtils::csv_mix_formulas:
file: lib/App/CSVUtils/csv_mix_formulas.pm
version: '0.002'
requires:
App::CSVUtils: '0.032'
Data::Sah::Compiler::perl::TH::array: '0.914'
Data::Sah::Compiler::perl::TH::bool: '0.914'
Data::Sah::Compiler::perl::TH::str: '0.914'
Data::Sah::Filter::perl::Path::expand_tilde_when_on_unix: '0'
Data::Sah::Filter::perl::Path::strip_slashes_when_on_unix: '0'
List::Util: '1.54'
Log::ger: '0.038'
Perinci::CmdLine::Any: '0.154'
Perinci::CmdLine::Lite: '1.924'
Perinci::Sub::XCompletion::filename: '0'
Sah::Schema::filename: '0'
Sah::Schema::true: '0'
perl: '5.010001'
strict: '0'
warnings: '0'
resources:
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=App-CSVUtils-csv_mix_formulas
homepage: https://metacpan.org/release/App-CSVUtils-csv_mix_formulas
repository: git://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas.git
version: '0.002'
x_Dist_Zilla:
perl:
version: '5.038002'
plugins:
-
class: Dist::Zilla::Plugin::GenPericmdScript
name: 'GenPericmdScript csv-mix-formulas'
version: '0.425'
-
class: Dist::Zilla::Plugin::InsertExecsList
name: InsertExecsList
version: '0.032'
-
class: Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease
name: '@Author::PERLANCAR/PERLANCAR::CheckPendingRelease'
version: '0.001'
-
Makefile.PL view on Meta::CPAN
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.031.
use strict;
use warnings;
use 5.010001;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula",
"AUTHOR" => "perlancar <perlancar\@cpan.org>",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "App-CSVUtils-csv_mix_formulas",
"EXE_FILES" => [
"script/csv-mix-formulas"
],
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.010001",
"NAME" => "App::CSVUtils::csv_mix_formulas",
"PREREQ_PM" => {
"App::CSVUtils" => "0.032",
"Data::Sah::Compiler::perl::TH::array" => "0.914",
"Data::Sah::Compiler::perl::TH::bool" => "0.914",
"Data::Sah::Compiler::perl::TH::str" => "0.914",
"Data::Sah::Filter::perl::Path::expand_tilde_when_on_unix" => 0,
"Data::Sah::Filter::perl::Path::strip_slashes_when_on_unix" => 0,
"List::Util" => "1.54",
"Log::ger" => "0.038",
"Perinci::CmdLine::Any" => "0.154",
NAME
App::CSVUtils::csv_mix_formulas - Mix several formulas/recipes (lists of
ingredients and their weights/volumes) into one, and output the combined
formula
VERSION
This document describes version 0.002 of App::CSVUtils::csv_mix_formulas
(from Perl distribution App-CSVUtils-csv_mix_formulas), released on
2024-02-24.
FUNCTIONS
csv_mix_formulas
Usage:
csv_mix_formulas(%args) -> [$status_code, $reason, $payload, \%result_meta]
Mix several formulas/recipes (lists of ingredients and their
weights/volumes) into one, and output the combined formula.
Each formula is a CSV comprised of at least two fields. The first field
(by default literally the first field, but can also be specified using
"--ingredient-field") is assumed to contain the name of ingredients. The
second field (by default literally the second field, but can also be
specified using "--weight-field") is assumed to contain the weight of
ingredients. A percent form is recognized and will be converted to its
decimal form (e.g. "60%" or "60.0 %" will become 0.6).
Example, mixing this CSV:
ingredient,%weight,extra-field1,extra-field2
and this:
ingredient,%weight,extra-field1,extra-field2,extra-field3
lemon syrup,5.75,bar,baz,qux
citric acid,0.25,bar,baz,qux
sugar,14,bar,baz,qux
water,80,bar,baz,qux
will result in the following CSV. Note: 1) for the header, except for
the first two fields which are the ingredient name and weight which will
contain the mixed formula, the other fields will simply collect values
from all the CSV files. 2) for sorting order: decreasing weight then by
name.
ingredient,%weight,extra-field1,extra-field2,extra-field3
water,80,foo,bar,qux
sugar,14.5,foor,bar,qux
lemon syrup,2.875,bar,baz,qux
strawberry syrup,2.35,foo,bar,
citric acid,0.275,foo,bar,qux
result, but usually not present when enveloped result is an error
response ($status_code is not 2xx). Fourth element (%result_meta) is
called result metadata and is optional, a hash that contains extra
information, much like how HTTP response headers provide additional
metadata.
Return value: (any)
HOMEPAGE
Please visit the project's homepage at
<https://metacpan.org/release/App-CSVUtils-csv_mix_formulas>.
SOURCE
Source repository is at
<https://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas>.
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull
requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You
can simply modify the code, then test via:
COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website
<https://rt.cpan.org/Public/Dist/Display.html?Name=App-CSVUtils-csv_mix_
formulas>
When submitting a bug or request, please include a test-file or a patch
to an existing test-file that illustrates the bug or desired feature.
;---------------------------------
author = perlancar <perlancar@cpan.org>
copyright_holder = perlancar <perlancar@cpan.org>
license = Perl_5
;---------------------------------
version=0.002
name=App-CSVUtils-csv_mix_formulas
[GenPericmdScript / GenPericmdScript csv-mix-formulas]
url=/App/CSVUtils/csv_mix_formulas/csv_mix_formulas
read_config=0
read_env=0
use_utf8=1
enable_log=1
[InsertExecsList]
[@Author::PERLANCAR]
:version=0.610
[Prereqs / TestRequires]
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
package App::CSVUtils::csv_mix_formulas;
use 5.010001;
use strict;
use warnings;
use Log::ger;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2024-02-24'; # DATE
our $DIST = 'App-CSVUtils-csv_mix_formulas'; # DIST
our $VERSION = '0.002'; # VERSION
use App::CSVUtils qw(
gen_csv_util
);
use List::Util qw(sum);
gen_csv_util(
name => 'csv_mix_formulas',
summary => 'Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, '.
'and output the combined formula',
description => <<'MARKDOWN',
Each formula is a CSV comprised of at least two fields. The first field (by
default literally the first field, but can also be specified using
`--ingredient-field`) is assumed to contain the name of ingredients. The second
field (by default literally the second field, but can also be specified using
`--weight-field`) is assumed to contain the weight of ingredients. A percent
form is recognized and will be converted to its decimal form (e.g. "60%" or
"60.0 %" will become 0.6).
Example, mixing this CSV:
ingredient,%weight,extra-field1,extra-field2
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
and this:
ingredient,%weight,extra-field1,extra-field2,extra-field3
lemon syrup,5.75,bar,baz,qux
citric acid,0.25,bar,baz,qux
sugar,14,bar,baz,qux
water,80,bar,baz,qux
will result in the following CSV. Note: 1) for the header, except for the first
two fields which are the ingredient name and weight which will contain the mixed
formula, the other fields will simply collect values from all the CSV files. 2)
for sorting order: decreasing weight then by name.
ingredient,%weight,extra-field1,extra-field2,extra-field3
water,80,foo,bar,qux
sugar,14.5,foor,bar,qux
lemon syrup,2.875,bar,baz,qux
strawberry syrup,2.35,foo,bar,
citric acid,0.275,foo,bar,qux
Keywords: compositions, mixture, combine
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
$r->{weight_field} = undef;
},
on_input_header_row => sub {
my $r = shift;
# TODO: allow to customize
if ($r->{input_filenum} == 1) {
# assign the ingredient field and weight field
if (defined $r->{util_args}{ingredient_field}) {
die "csv-mix-formulas: FATAL: Specified ingredient field does not exist\n"
unless defined $r->{input_fields_idx}{ $r->{util_args}{ingredient_field} };
$r->{ingredient_field} = $r->{util_args}{ingredient_field};
die "csv-mix-formulas: FATAL: Specified weight field does not exist\n"
unless defined $r->{input_fields_idx}{ $r->{util_args}{weight_field} };
$r->{weight_field} = $r->{util_args}{weight_field};
} else {
die "csv-mix-formulas: FATAL: At least 2 fields are required\n" unless @{ $r->{input_fields} } >= 2;
$r->{ingredient_field} = $r->{input_fields}[0];
$r->{weight_field} = $r->{input_fields}[1];
}
}
# after we read the header row of each input file, we record the fields
# as well as the filehandle, so we can resume reading the data rows
# later. before printing all the rows, we collect all the fields from
# all files first.
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
push @{ $ingredient_row->{$field} }, $row->[$j];
} else {
$ingredient_row->{$field} //= $row->[$j];
}
}
}
}
#use DD; dd $ingredients;
my $num_formulas = @{ $r->{input_filenames} };
return unless $num_formulas;
# calculate the weights of the mixed formula
for my $ingredient (keys %{ $ingredients }) {
$ingredients->{$ingredient}{ $r->{weight_field} } = sum( @{ $ingredients->{$ingredient}{ $r->{weight_field} } } ) / $num_formulas;
}
for my $ingredient (sort { ($ingredients->{$b}{ $r->{weight_field} } <=> $ingredients->{$a}{ $r->{weight_field} }) ||
(lc($a) cmp lc($b)) } keys %$ingredients) {
FORMAT: for my $weight ($ingredients->{ $r->{weight_field} }) {
if ($r->{util_args}{output_percent}) {
$weight = ($weight * 100) . "%";
last FORMAT;
} elsif ($r->{util_args}{output_percent_nosign}) {
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
$weight = sprintf($r->{util_args}{output_format}, $weight);
}
} # FORMAT
$r->{code_print_row}->($ingredients->{$ingredient});
}
},
);
1;
# ABSTRACT: Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula
__END__
=pod
=encoding UTF-8
=head1 NAME
App::CSVUtils::csv_mix_formulas - Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula
=head1 VERSION
This document describes version 0.002 of App::CSVUtils::csv_mix_formulas (from Perl distribution App-CSVUtils-csv_mix_formulas), released on 2024-02-24.
=head1 FUNCTIONS
=head2 csv_mix_formulas
Usage:
csv_mix_formulas(%args) -> [$status_code, $reason, $payload, \%result_meta]
Mix several formulasE<sol>recipes (lists of ingredients and their weightsE<sol>volumes) into one, and output the combined formula.
Each formula is a CSV comprised of at least two fields. The first field (by
default literally the first field, but can also be specified using
C<--ingredient-field>) is assumed to contain the name of ingredients. The second
field (by default literally the second field, but can also be specified using
C<--weight-field>) is assumed to contain the weight of ingredients. A percent
form is recognized and will be converted to its decimal form (e.g. "60%" or
"60.0 %" will become 0.6).
Example, mixing this CSV:
ingredient,%weight,extra-field1,extra-field2
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
and this:
ingredient,%weight,extra-field1,extra-field2,extra-field3
lemon syrup,5.75,bar,baz,qux
citric acid,0.25,bar,baz,qux
sugar,14,bar,baz,qux
water,80,bar,baz,qux
will result in the following CSV. Note: 1) for the header, except for the first
two fields which are the ingredient name and weight which will contain the mixed
formula, the other fields will simply collect values from all the CSV files. 2)
for sorting order: decreasing weight then by name.
ingredient,%weight,extra-field1,extra-field2,extra-field3
water,80,foo,bar,qux
sugar,14.5,foor,bar,qux
lemon syrup,2.875,bar,baz,qux
strawberry syrup,2.35,foo,bar,
citric acid,0.275,foo,bar,qux
Keywords: compositions, mixture, combine
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.
Return value: (any)
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-CSVUtils-csv_mix_formulas>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas>.
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-CSVUtils-csv_mix_formulas>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
=cut
script/csv-mix-formulas view on Meta::CPAN
#!perl
# Note: This script is a CLI for Riap function /App/CSVUtils/csv_mix_formulas/csv_mix_formulas
# and generated automatically using Perinci::CmdLine::Gen version 0.502
use 5.010001;
use strict;
use warnings;
use Log::ger;
use Perinci::CmdLine::Any;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2024-02-24'; # DATE
our $DIST = 'App-CSVUtils-csv_mix_formulas'; # DIST
our $VERSION = '0.002'; # VERSION
my $cmdline = Perinci::CmdLine::Any->new(
url => "/App/CSVUtils/csv_mix_formulas/csv_mix_formulas",
program_name => "csv-mix-formulas",
log => 1,
read_config => 0,
read_env => 0,
use_utf8 => 1,
);
$cmdline->run;
# ABSTRACT: Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula
# PODNAME: csv-mix-formulas
__END__
=pod
=encoding UTF-8
=head1 NAME
csv-mix-formulas - Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula
=head1 VERSION
This document describes version 0.002 of csv-mix-formulas (from Perl distribution App-CSVUtils-csv_mix_formulas), released on 2024-02-24.
=head1 SYNOPSIS
B<csv-mix-formulas> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<csv-mix-formulas> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<csv-mix-formulas> [B<L<--debug|/"--debug">>|B<L<--log-level|/"--log-level=s">>=I<level>|B<L<--quiet|/"--quiet">>|B<L<--trace|/"--trace">>|B<L<--verbose|/"--verbose">>] [B<L<--format|/"--format=s">>=I<name>|B<L<--json|/"--json">>] [B<L<--ingredient-...
=head1 DESCRIPTION
Each formula is a CSV comprised of at least two fields. The first field (by
default literally the first field, but can also be specified using
C<--ingredient-field>) is assumed to contain the name of ingredients. The second
field (by default literally the second field, but can also be specified using
C<--weight-field>) is assumed to contain the weight of ingredients. A percent
form is recognized and will be converted to its decimal form (e.g. "60%" or
"60.0 %" will become 0.6).
Example, mixing this CSV:
ingredient,%weight,extra-field1,extra-field2
script/csv-mix-formulas view on Meta::CPAN
and this:
ingredient,%weight,extra-field1,extra-field2,extra-field3
lemon syrup,5.75,bar,baz,qux
citric acid,0.25,bar,baz,qux
sugar,14,bar,baz,qux
water,80,bar,baz,qux
will result in the following CSV. Note: 1) for the header, except for the first
two fields which are the ingredient name and weight which will contain the mixed
formula, the other fields will simply collect values from all the CSV files. 2)
for sorting order: decreasing weight then by name.
ingredient,%weight,extra-field1,extra-field2,extra-field3
water,80,foo,bar,qux
sugar,14.5,foor,bar,qux
lemon syrup,2.875,bar,baz,qux
strawberry syrup,2.35,foo,bar,
citric acid,0.275,foo,bar,qux
Keywords: compositions, mixture, combine
script/csv-mix-formulas view on Meta::CPAN
=head1 COMPLETION
This script has shell tab completion capability with support for several
shells.
=head2 bash
To activate bash completion for this script, put:
complete -C csv-mix-formulas csv-mix-formulas
in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.
It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.
=head2 tcsh
To activate tcsh completion for this script, put:
complete csv-mix-formulas 'p/*/`csv-mix-formulas`/'
in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.
It is also recommended to install L<shcompgen> (see above).
=head2 other shells
For fish and zsh, install L<shcompgen> as described above.
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-CSVUtils-csv_mix_formulas>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-CSVUtils-csv_mix_formulas>.
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.
script/csv-mix-formulas view on Meta::CPAN
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-CSVUtils-csv_mix_formulas>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
=cut
t/00-compile.t view on Meta::CPAN
use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
use Test::More;
plan tests => 2 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
my @module_files = (
'App/CSVUtils/csv_mix_formulas.pm'
);
my @scripts = (
'script/csv-mix-formulas'
);
# no fake home requested
my @switches = (
-d 'blib' ? '-Mblib' : '-Ilib',
);
use File::Spec;
use IPC::Open3;
t/author-critic.t view on Meta::CPAN
}
use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::Perl::Critic::Subset 3.001.006
use Test::Perl::Critic (-profile => "") x!! -e "";
my $filenames = ['lib/App/CSVUtils/csv_mix_formulas.pm','script/csv-mix-formulas'];
unless ($filenames && @$filenames) {
$filenames = -d "blib" ? ["blib"] : ["lib"];
}
all_critic_ok(@$filenames);