% if (keys %{$thread}) { %= $thread->{'id'}; %= $thread->{'title'}; %= $thread->{'date'}; %= $thread->{'author'}; %= $thread->{'body'}; % } else { %= stash 'error'; % }