in reply to Re^3: die properly
in thread die properly

Ok, that's how I did
eval { &feed; }; unless ( $@ ) { &error; } sub feed { ...code... while($l < $2) { ...code... } die "Could not retreive data"; }

And it seems to be working.

Replies are listed 'Best First'.
Re^5: die properly
by tlm (Prior) on May 12, 2005 at 20:39 UTC

    If it seems to be working, then it is a remarkable form of working, because the logic is backwards from what dragonchild posted. Notice that after the eval, his code acted on the error if $@ evaluated to true, while yours acts on the error if $@ is false (i.e. when there are actually no errors).

    the lowliest monk

      But it will not work otherwise, how would you do it?