tag:blogger.com,1999:blog-2739183401070539028.post9162530568773518443..comments2023-03-08T07:25:00.530+01:00Comments on Try before you buy: Perl parameter validation and error handlingNikhttp://www.blogger.com/profile/08322215950778776217noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2739183401070539028.post-50597479290439333282010-11-11T15:15:51.142+01:002010-11-11T15:15:51.142+01:00Exception::Class has a problem that it is not very...Exception::Class has a problem that it is not very clever telling the error file and line.<br /><br />If you make use methods $exception->file() and $exception->line() they give wrong location.<br /><br />If you use instead<br />...<br />use Carp;<br />Params::Validate::validation_options(on_fail => sub { croak (shift)) });<br /><br />Then you get the correct location for the error. (but then your are not using Exception::Class which is otherwise a good module).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2739183401070539028.post-30634661346479760552007-01-16T07:54:00.000+01:002007-01-16T07:54:00.000+01:00This is good stuff, and I'm *so* glad you wrote it...This is good stuff, and I'm *so* glad you wrote it -- since now I don't have to. :-)<br><br>I just changed jobs, and the lucky person that gets to be the new me needed a primer on these two topics, using the very same modules. Thanks for saving me a few hours!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2739183401070539028.post-3980368552048539392007-04-20T10:51:00.000+02:002007-04-20T10:51:00.000+02:00Perl parameter validation and error handling...Exa...<strong>Perl parameter validation and error handling...</strong><br><br>Examples of how to use Params::Validate and Exception::Class together to do sub/method parameter validation....Anonymousnoreply@blogger.com