CGI::Application::CheckRM is a Perl module that checks run modes using Data::FormValidator.
use base 'CGI::Application::CheckRM';
|| return $s->switch_to('myOtherRunMode');
my $ERRORS = $s->dfv_resuts->msgs
The integration with CGI::Application::Magic is very powerful.
You need just to pass the profile to the checkRM() method and put the labels in the template: no other configuration needed on your side: the error labels in any template will be auto-magically substituted with the error string when needed.
Note: The hash reference returned by the msgs() method will be internally passed as a lookup location to the Template::Magic object.