in reply to Pattern for a shell-style call + error response

One common method in other languages is:
my $ret = $item->frobinize(...); die "Error occured." if $ret;
It's clean and simple. I like it better than 'and'.

-- 
asksh <ask@0x61736b.net>

Replies are listed 'Best First'.
Re^2: Pattern for a shell-style call + error response
by djp (Hermit) on May 07, 2007 at 02:06 UTC
    The advantage of this method is that you get a handle on $ret, which will usually have some meaning. So you can print it in an error message, or something.