6 # 2010-07-13 Dobrica Pavlinusic <dpavlin@rot13.org>
8 use Data::Dump qw/dump/;
14 my $path = shift @ARGV || die "usage: $0 file.csv\n";
16 my $csv = Text::CSV->new ( { binary => 1 } ) # should set binary attribute.
17 or die "Cannot use CSV: ".Text::CSV->error_diag ();
19 open my $fh, "<:encoding(utf8)", $path or die "$path: $!";
20 while ( my $row = $csv->getline( $fh ) ) {
22 my ( $ulica, $grad ) = split(/\s*,\s*/, $row->[8]);
26 adresa_ulica => $ulica,
28 tel_fixed => $row->[9],
29 tel_mobile => $row->[10],
30 spol => substr($row->[2],9,3) < 500 ? 'M' : 'F',
33 warn dump($row, $info);
34 #DumpFile( "yaml/$uuid.yaml", $hash );
36 $csv->eof or $csv->error_diag();