in reply to $DBI::errstr and Tk:Error
#Set a global my $sqlerror = undef; $entrysql->bind('<Return>',[sub { $sql = $entrysql->get; my $sth; eval {$sth = $dbh->prepare("select $mainstr from info $sql") #or warn DBI::errstr $!; or Tk::Error $!; $sth->finish; }; if($sqlerror){print chr(07);$sqlerror = undef; return;} print "ok\n"; .....continue on ######################################################## sub Tk::Error { (undef,$sqlerror,undef) = @_; print "my error->$sqlerror\n"; }
|
|---|