85 |
my $sql_dir = $ENV{SCRIPT_FILENAME} || '.'; |
my $sql_dir = $ENV{SCRIPT_FILENAME} || '.'; |
86 |
$sql_dir =~ s,/[^/]+$,,; |
$sql_dir =~ s,/[^/]+$,,; |
87 |
|
|
88 |
my $config_path = "$sql_dir/config.pl"; |
my $config_path = $1 if "$sql_dir/config.pl" =~ m/^(.+)$/; # untaint |
89 |
warn "# using $config_path\n"; |
warn "# using $config_path\n"; |
90 |
require $config_path if -e $config_path; |
require $config_path if -e $config_path; |
91 |
|
|
116 |
my $dbh = DBI->connect($dsn . $database,$user,$passwd, { RaiseError => 1, AutoCommit => 0 }) || die $DBI::errstr; |
my $dbh = DBI->connect($dsn . $database,$user,$passwd, { RaiseError => 1, AutoCommit => 0 }) || die $DBI::errstr; |
117 |
|
|
118 |
sub _c { |
sub _c { |
119 |
|
return shift unless $db_encoding; |
120 |
return decode( $db_encoding, shift ); |
return decode( $db_encoding, shift ); |
121 |
} |
} |
122 |
|
|