in reply to Is it required to map a Plack/PSGI middleware?
What means "mapped"?
See Middleware of PSGI
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, ); [download]
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.