During my build of my first poper fully functional Mojo app, I came acros the following and I don't really know if this is intentional (or if it has been addressed already)
Below is a lite app that shows the problem, in my case I'm getting some data from a database adding them to a form (given to taghelpers) and also add the data to a live preview part where the data is just inserted via %= param('field') or %== param('field'). Some data may be null fields. and that gave raise to this small difference.
So my question is: Is %= and %== suppose to have different handling of undef data?
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
$c->render(template => 'index');
};
app->start;
__DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
This is testing a bug in Mojo::Template: The term <code>%= param('bug')</code> handles undefined 'bug' just fine,
whereas <code>%== param('bug')</code> gives an <code style="color:red">Use of uninitialized value in concatenation</code> warning in morbo
%= param('bug')
%== param('bug')
%= undef
%== undef
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head><title><%= title %></title></head>
<body><%= content %></body>
</html>
/daleif