If the template doesn't use <TMPL_VAR UUID> there's no point in
incurring any cost.
$template->param(name => $page);
- eval {
- require UUID::Tiny;
- UUID::Tiny->import(':std');
- my $uuid;
- $uuid = create_uuid_as_string(UUID_V4());
- $template->param(uuid => $uuid);
- };
+ if ($template->query(name => 'uuid')) {
+ eval {
+ require UUID::Tiny;
+ UUID::Tiny->import(':std');
+ my $uuid;
+ $uuid = create_uuid_as_string(UUID_V4());
+ $template->param(uuid => $uuid);
+ };
+ }
return $template->output;
}