if(ref($return=&yoursubhere($a->(),$s->())ne"CODE"){ #error } &nextsub($return->())