#!/usr/local/bin/perl use warnings; use Data::Dumper; use Mojolicious::Lite -signatures; use Mojolicious::Static; # Let's just say all we know about the image is my $directory = 'c:/xyzzy/test/'; # some arbitrary directory my $name = 'TEST'; my $extension = '.jpg'; # And we want to create the page as in "picture.html.ep" get '/picture' => sub($c) { #my $static = Mojolicious::Static->new; $c->stash(name=>$name,extension=>$extension); # The following generates #" Can't locate object method "static" via package "Mojolicious::Controller"" warn Data::Dumper->new([\$c->static->paths],[qw(path)])->Dump(),q{ }; push @{$c->static->paths}, $directory; warn Data::Dumper->new([\$c->static->paths],[qw(path)])->Dump(),q{ }; }; app->start; __DATA__ @@ picture.html.ep