I have an issue with a script I've inherited. Before going into the issue I realise that running a command in the way it's done is probably not the most sensible thing to do. Anyhow , the code does this
my $sqlpath="$ENV{SYBASE}/$ENV{SYBASE_OCS}/bin/isql";
open(ISQL, "$sqlpath -U$user -S$server -b -i$script -w1024 -P$passw
+ord |") or die "Can't run isql $!\n";
close(ISQL);
}
The $script is a user supplied sql script of usually of the format
command
go
command
go
command
go
The question I have is how do I trap any errors that may come back from the running of the script through the isql call ?
Alternatively does anybody know of any module I can use that will execute a user supplied script via DBI/DBD where the error handling would be much easier ?