| 1 | package App::CSVUtils::csv_quote; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 8 | 1 | our $DATE = '2026-07-09'; # DATE | |||||||||
| 9 | 1 | our $DIST = 'App-CSVUtils'; # DIST | |||||||||
| 10 | 1 | our $VERSION = '1.038'; # VERSION | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use App::CSVUtils::csv_csv; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use Perinci::Sub::Util qw(gen_modified_sub); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | my $res = gen_modified_sub( | ||||||||||
| 16 | output_name => 'csv_quote', | ||||||||||
| 17 | base_name => 'App::CSVUtils::csv_csv::csv_csv', | ||||||||||
| 18 | summary => 'Make sure values of CSV are quoted', | ||||||||||
| 19 | description => <<'MARKDOWN', | ||||||||||
| 20 | |||||||||||
| 21 | This is a simple wrapper to <prog:csv-csv>. It's equivalent to: | ||||||||||
| 22 | |||||||||||
| 23 | % csv-csv --output-always-quote --output-quote-empty ... | ||||||||||
| 24 | |||||||||||
| 25 | MARKDOWN | ||||||||||
| 26 | |||||||||||
| 27 | remove_args => [qw/output_always_quote output_quote_emty/], | ||||||||||
| 28 | tags => ['category:munging', 'modifies-values'], | ||||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | modify_meta => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 1 | my $meta = shift; | |||||||||
| 32 | 1 | delete $meta->{args_rels}; | |||||||||
| 33 | $meta->{examples} = [ | ||||||||||
| 34 | { | ||||||||||
| 35 | 1 | summary => 'Make sure values of CSV are quoted', | |||||||||
| 36 | argv => ['file.csv'], | ||||||||||
| 37 | test => 0, | ||||||||||
| 38 | 'x.doc.show_result' => 0, | ||||||||||
| 39 | }, | ||||||||||
| 40 | ]; | ||||||||||
| 41 | $meta->{links} = [ | ||||||||||
| 42 | 1 | {url=>'prog:csv-unquote'}, | |||||||||
| 43 | ]; | ||||||||||
| 44 | }, | ||||||||||
| 45 | 0 | ▶ | output_code => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 46 | 0 | App::CSVUtils::csv_csv::csv_csv( | |||||||||
| 47 | @_, | ||||||||||
| 48 | output_always_quote => 1, | ||||||||||
| 49 | output_quote_empty => 1, | ||||||||||
| 50 | ); | ||||||||||
| 51 | }, | ||||||||||
| 52 | 1 | ); | |||||||||
| 53 | 1 | ▶ | die "Can't generate sub: $res->[0] - $res->[1]" unless $res->[0] == 200; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | |||||||||||
| 55 | 1 | 1; | |||||||||
| 56 | # ABSTRACT: Make sure values of CSV are quoted | ||||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||