I am putting together a Perl tool to manage a large set of tasks
related to building a rather complex set of software. One of the goals
for moving to Perl is to provide very rigorous error checking and
handling. One area that has me puzzled is error checking some of the
file system operations. Just simple things such as open, rename,
unlink, print and some others ... all the sample code I've seen uses
them in a form of:
open(...) || die "message $!"
Given this is part of a large tool, I'd far prefer to capture the
error code/message, report it via my messaging & tracing mechanism so
it gets recorded in the log file as well as getting displayed to the
user, and then decide if its a fatal error or if I'm going to attempt
to forge ahead in spite of it.
I've tried capturing a status return:
$status = open(...);
but this does not seem to return a useful return value.
Can someone please help me understand how I might provide the level of
error checking and control that I am looking for?
Thanks in advance for your assistance.
-Marc