common/tools/populateziptemplate.pl
changeset 89 a8aa5d600806
parent 88 28463bb10fde
child 90 5b27412eeaf0
equal deleted inserted replaced
88:28463bb10fde 89:a8aa5d600806
     1 use strict;
     1 use strict;
     2 use warnings;
     2 use warnings;
     3 
     3 
       
     4 use FindBin;
       
     5 use lib "$FindBin::Bin/lib";
     4 use Text::CSV;
     6 use Text::CSV;
     5 require XML::Simple;
     7 require XML::Simple;
     6 
     8 
     7 # Raw inputs come in as parameters to the script
     9 # Raw inputs come in as parameters to the script
     8 # TODO: Use a proper option parsing module
    10 # TODO: Use a proper option parsing module
    20 {
    22 {
    21 	chomp $line;
    23 	chomp $line;
    22 	next unless $line;
    24 	next unless $line;
    23 	unless ($csv->parse($line))
    25 	unless ($csv->parse($line))
    24 	{
    26 	{
    25 		my $err = $csv->error_input;
    27 		my $err = $csv->error_input();
    26 		die "Failed to parse line '$line': $err";
    28 		die "Failed to parse line '$line': $err";
    27 	}
    29 	}
    28 
    30 
    29 	if (! @keys)
    31 	if (! @keys)
    30 	{
    32 	{