I am a bit new to Perl and am having trouble trapping errors in script ...
However, I think that it is just simple syntax issues and hope that someone can point me towards a good HOWTO which might help me ...
I have a simple system call to a program (SQLPLUS) which works fine. And when I try to induce an error (for example by misspelling sqlplusw), perl recognises the problem and brings a message but doesn't seem to react to my attempts to trap the error.
Here I have tried both 'die' and 'warn' but it doesn't seem to make any difference. I have also tried to print STDERR but also can't seem to do this.
Here is a snippet of my code ...
system("sqlplusw\ \/nolog\ \@myscript.sql") || warn("SQLPlus not found");
sleep(2);
print "error: ", <STDERR>, "\n";
As you can see, I am a real newbie but am sure if someone could give me a tip or two or could point me towards a good tutorial, then I would sort it out very quickly.
Many thanks,
Alan Searle.