in reply to A couple of problems....
the advantage of a sub like that is that you can copy it to any script with no modification. It is a lot easier than messing with an error file every time.unlink ($_) or &error(1,"Unable to open file: $_"); sub error { open the log and print out stuff (including $!) if the first variable is 1, exit the script (die style) if the first variable is 0, return to where you were (warn style) }
|
|---|