in reply to Re^2: proper Sub::Contract use
in thread proper Sub::Contract use
I tried exceptions mechanism, but I think It has no use here - there is no way to handle exceptions outside validation functions. I decided just to use warn "in cascades", so I get info message like this:I think that your idea of warning in cascades is a good solution to the problem, so I don't want to discourage it, but I am confused by your qualification. What do you mean when you say that there is no way to handle exceptions outside validation functions? Unless I misunderstand what you're doing, all you have to do is wrap every validation in an eval {}, and check afterwards whether you caught an exception—which is not much more complicated than checking for truth or falsity anyway.
|
|---|