source: Dev/trunk/src/node_modules/ya-csv/test/perl-csv-test.pl @ 484

Last change on this file since 484 was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

  • Property svn:executable set to *
File size: 654 bytes
Line 
1#!/usr/bin/perl -w
2
3use Text::CSV_XS;
4
5my %CSV_OPTS_IN = (
6    'binary'        => 1,
7    'quote_char'    => '"',
8    'escape_char'   => '"',
9);
10my %CSV_OPTS_OUT = %CSV_OPTS_IN;
11$CSV_OPTS_OUT{'always_quote'} = 1;
12
13my $CSV_IN  = Text::CSV_XS->new(\%CSV_OPTS_IN)  or die "" . Text::CSV_XS->error_diag;
14
15sub main() {
16    my $start = localtime;
17    print "$start\n";
18    my $fh = *STDIN;
19
20    until ($CSV_IN->eof) {
21        my $hr = $CSV_IN->getline($fh) or do {
22            last if $CSV_IN->eof;
23            die "CSV_IN getline error: " . Text::CSV_XS->error_diag;
24        };
25        my $a = 0;
26    }
27
28    my $end = localtime;
29    print "$end\n";
30}
31
32main();
Note: See TracBrowser for help on using the repository browser.