in reply to style for returning errors from subroutines
yoursubhere is called without checking like &yoursubhere($a->(),$s->())->() or with check likesub makeclosure { my @x=(@_); return sub { return @x } } sub yoursubhere{ #do stuff return makeclosure(val1,val2); #on error return bless sub {undef or die},"errormessage";
if(ref($return=&yoursubhere($a->(),$s->())ne"CODE"){ #error } &nextsub($return->())
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: style for returning errors from subroutines
by Boldra (Curate) on Jun 15, 2001 at 13:54 UTC | |
by Anonymous Monk on Jun 15, 2001 at 18:08 UTC |