in reply to Re: Flock, die and statement order
in thread Flock, die and statement order

Why is warn() going to the page? It should be going to STDERR and the server's error log. If you are handling errors, you can catch the die with an eval block.
eval { might_die() }; if ($@) { # handle exception }

Replies are listed 'Best First'.
Re: Flock, die and statement order
by Ionizor (Pilgrim) on Nov 20, 2002 at 14:19 UTC

    I guess I misunderstood where warn() outputs to; my apologies. In any case the error message shouldn't be going to the server's error log because it's a message intended for the script's end user.

    I guess I'm just not clear why an eval block / die is better than the nested ifs I have. The script code is well commented and traps errors so what is the advantage of using die?