Subject: | Allow dispatchers to return false |
If a dispatcher returns a false value, WD should continue with the next dispatcher instead of dying with.Use of uninitialized value in subroutine entry at /usr/share/perl5/Web/Dispatch.pm line 129.
For example, the following script should work without the dummy response_filter:
#!/usr/bin/perl -w
use v5.14;
package Example;
use Web::Simple;
sub dispatch_request{
sub (?:param=) {
return [403, ['Content-Type' => 'text/plain'], ['Forbidden']] unless $_{param} =~ /^\w+$/;
response_filter { shift }; # Dummy response_filter
},
sub (/a + ?:param=) { ... },
sub (/b + ?:param=) { ... },
sub (/c + ?:param=) { ... },
sub (/d + ?:param=) { ... },
}
Example->run_if_script;