[Dancer-users] Matching a route including slashes (for directory listing)

Joel Roth joelz at pobox.com
Sun Jan 30 10:46:59 CET 2011


Hi all,

I'm trying to create an Apache-style directory
view with links to files and subdirectories and showing file
length.

I'm attempting to match a route like '/media/foo/bar'
and generate a directory listing for /public/foo/bar.

I was playing with this tonight:

get '/media/*' => sub { my $path = splat; ... }

This matches '/media/foo' but I was expecting it to match
'/media/foo/bar'.

It appears that * doesn't match slashes.

'/media/([\w/]+)' doesn't seem to work, either.

I'd welcome suggestions for either problem: 

1. matching paths with several levels of hierarchy
2. listing a directory

Kind regards,

Joel

-- 
Joel Roth


More information about the Dancer-users mailing list