blib/lib/oEdtk/lib/acq_Load.pl untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 use strict;
4 use warnings;
5 use oEdtk;
6 use oEdtk::Main;
7 use oEdtk::Config qw(config_read);
8 use oEdtk::DBAdmin qw(db_connect csv_import);
9 my $header = 'ED_SEQLOT,ED_LOTNAME,ED_DTPRINT,ED_DTPOST,ED_NBFACES,ED_NBPLIS,ED_DTPOST2';
10  
11 if ( @ARGV < 1 or $ARGV[0] =~ /-h/i ) {
12 warn "Usage: $0 <acq_file>\n";
13 warn "\n\tThis will import csv acq file into acq table.\n";
14 warn "\tcsv import file should have this structure :\n $header\n";
15 exit 1;
16 }
17  
18 my $cfg = config_read('EDTK_DB');
19 my $dbh = db_connect( $cfg, 'EDTK_DBI_DSN', { AutoCommit => 1, RaiseError => 1 } );
20  
21 csv_import(
22 $dbh,
23 "EDTK_ACQ",
24 $ARGV[0],
25 {
26 mode => 'merge',
27 header => $header
28 }
29 );
30  
31 1;