I am following the Mojolicious lite tutorial but struggling to generate a page with the <pre>content</pre>
formatting.
Waht do I need to change so that the output is formatted as a block of <pre>content</pre>
HTML?
Here is what I have:
#!/usr/bin/env perl
use Mojolicious::Lite -signatures;
get '/foo' => sub ($c) {
my $id = $c->param("id");
my $cmd = "perl /home/user/tool.pl -id $id 2>&1";
my $ret = `$cmd`;
# $c->render(text => $id);
$c->render(text => $ret, layout => 'default');
};
app->start;
__DATA__
@@ layouts/foo.html.ep
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
</head>
<body>
<pre>
%= content
</pre>
</body>
</html>