in reply to sql-o-matic
my $dbh=DBI->connect($dsn,$opts{user}{value},$opts{password}{value}) | +| die($!);
The || operator has higher precedence than the = operator so you should either enclose the assignment in parentheses or use the lower precedence or operator.
According to the DBI manual:
If the connect fails (see below), it returns "undef" and sets both $DBI::err and $DBI::errstr. (It does not explicitly set $!.) You should generally test the return status of "connect" and "print $DBI::errstr" if it has failed.
So that line should be:
my $dbh = DBI->connect( $dsn, $opts{ user }{ value }, $opts{ password +}{ value } ) or die $DBI::errstr;
crash_n_burn() if $cl_part=~/^-h$|^--help$|^-h$/i;
If the first ^-h$ pattern doesn't match what makes you think that the second one will?
$s_insert=<<EOT; /* Insert SP for $table */ drop procedure if exists insert_$table; delimiter // create procedure insert_table ( EOT
Shouldn't that be:
$s_insert=<<EOT; /* Insert SP for $table */ drop procedure if exists insert_$table; delimiter // create procedure insert_$table ( EOT
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sql-o-matic
by ambrus (Abbot) on Sep 16, 2008 at 14:26 UTC | |
by massa (Hermit) on Sep 16, 2008 at 16:26 UTC |