Group
Extension

Matches 4

Data-Validate-CSV ( T/TO/TOBYINK/Data-Validate-CSV-0.003.tar.gz, TOBYINK, 2019; MetaCPAN )
Data-Validate-CSV/lib/Data/Validate/CSV.pm ( view source; MetaCPAN )
ing utf-8

=head1 NAME

Data::Validate::CSV - read and validate CSV

=head1 SYNOPSIS

CSV Schema (JSON):

  {
    "@context": "http://www.w3.org/ns/csvw",
    "url": "countries.csv",
    "tableSchema"

  
  my $table = Data::Validate::CSV::Table->new(
    schema     => path('countries.csv-metadata.json'),
    input      => path('countries.csv'),
    has_header => !!0,
  );
  
  while (my $row = $ta
tributes:

=over

=item C<< schema >>

A schema for the table. Can be a hashref, a JSON string, a scalar ref to
a JSON string, or a L<Path::Tiny> path to a file containing the schema.

=item C<< input
Data-Validate-CSV ( T/TO/TOBYINK/Data-Validate-CSV-0.003.tar.gz, TOBYINK, 2019; MetaCPAN )
Data-Validate-CSV/lib/Data/Validate/CSV/Column.pm ( view source; MetaCPAN )
e JSON::PP;
	require Types::XSD;
	
	if ($self->has_separator) {
		@values = map {
			($_ eq '' || !defined) ? () : split quotemeta($self->separator)
		} @values;
	}

	unless ($base =~ /^(string|json|x
ml|html|anyatomictype)^/) {
		s/[\t\r\n]/ /g for @values;
	}
	
	unless ($base =~ /^(string|json|xml|html|anyatomictype|normalizedstring)^/) {
		s/\s+/ /g for @values;
		s/^\s+//g for @values;
		s/\s+$
	if ($obj and $base eq 'boolean') {
				($c eq 'true'  || $c eq '1') ? JSON::PP::true() :
				($c eq 'false' || $c eq '0') ? JSON::PP::false() :
				do { push @$errs, sprintf('Value %s is not a valid 
Data-Validate-CSV ( T/TO/TOBYINK/Data-Validate-CSV-0.003.tar.gz, TOBYINK, 2019; MetaCPAN )
Data-Validate-CSV/lib/Data/Validate/CSV/Schema.pm ( view source; MetaCPAN )
ny::path(@_);
	$class->new_from_json( $file->slurp_utf8 );
}

sub new_from_json {
	my $class = shift;
	my ($str) = @_;
	require JSON::PP;
	$class->new_from_hashref( JSON::PP->new->decode(ref $str ? $$
Data-Validate-CSV ( T/TO/TOBYINK/Data-Validate-CSV-0.003.tar.gz, TOBYINK, 2019; MetaCPAN )
Data-Validate-CSV/lib/Data/Validate/CSV/Types.pm ( view source; MetaCPAN )
SV::Schema'->new_from_hashref($_) },
		Str|ScalarRef,  q{ 'Data::Validate::CSV::Schema'->new_from_json($_) },
		Path,           q{ 'Data::Validate::CSV::Schema'->new_from_file($_) },
	],
));

__PACKAG

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.