in reply to Re: Re: style for returning errors from subroutines
in thread style for returning errors from subroutines

The closure is a holder for a value. You can instead return an error. That is a subref (legally the same as a closure, but not holding a value) that on deref gives a default (including a possibility to leave the program for dead) but is blessed to contain the error and at the same time providing an easy test to distinguish from a closure.
  • Comment on Re: Re: Re: style for returning errors from subroutines