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
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mojolicious/7e61bc91-c257-421d-a201-8540a1dc139b%40googlegroups.com.