#!/usr/bin/env perl use Mojolicious::Lite; use Path::Tiny; plugin 'TagHelpers'; get '/' => sub{ my $c = shift; my $path = path("/Foo/Bar/Baz"); $c->stash(filepath => $path, files => [$path->children(qr/\.txt/)] ); $c->render('index'); }; post '/' => sub{ my $c = shift; my $file = $c->param('id'); print $file; # print to console $c->render(text => $file); }; app->start; __DATA__ @@ index.html.ep % layout 'default'; % title $filepath ;

Let's test the files in <%= $filepath %>!

% foreach my $file (@$files) { % }
File Action
<%= $file %> %= form_for '/' => (method => 'POST') => begin %= submit_button 'validate', id => $file % end
@@ layouts/default.html.ep <%= title %> <%= content %> #### get '/validate/*filename' => sub{ my $c = shift; print $c->param('filename'),"\n\n\n\n"; # print to console $c->render('index'); }; ####