Kelp

 view release on metacpan or  search on metacpan

lib/Kelp/Manual.pod  view on Meta::CPAN

294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
Using regular expressions is so Perl. Sometimes, however, it gets a little
overwhelming. Use named paths if you anticipate that you or someone else will
ever want to maintain your code.
 
=head4 Explicit
 
    $r->add( "/update/:id", "update" );
 
    # Later
    sub update {
        my ( $self, $id ) = @_;
        # Do something with $id
    }
 
=head4 Optional
 
    $r->add( "/person/?name", sub {
        my ( $self, $name ) = @_;
        return "I am " . $name // "nobody";
    });



( run in 1.027 second using v1.01-cache-2.11-cpan-49f99fa48dc )