in reply to Re: Is it required to map a Plack/PSGI middleware?
in thread Is it required to map a Plack/PSGI middleware?

Mapping in this case simply means the routing or the redirection of a request. I included a dispatch table in the code:

my %routing = ( '/submit' => $form_validator, '/' => $form, );

When you submit the HTML form, it is sent to the URL '/submit' as defined by the HTML form attribute 'action'. Since '/submit' is associated with $form_validator, the anonymous function that the $form_validator refers to is invoked.