Think about Loose Coupling | |
PerlMonks |
Re: How to return errors from my object oriented subroutineby TVSET (Chaplain) |
on Aug 20, 2003 at 08:00 UTC ( [id://285125]=note: print w/replies, xml ) | Need Help?? |
I usually do something like this:
This approach provides a convinient way to display errors later on, if need be, while still validating provided data and saving on processing if ugly staff was given.
Now, if you need to display only errors you can do:
If you need to show to the user an OK message too, then just call display_status(@errors) unconditionally. my two cents
In Section
Seekers of Perl Wisdom
|
|