Write an ‘alert’ helper 

my %global;

hook 'before' => sub {
    %global = ( ); # Reset tokens for this request
};

sub alert {
    my($message) = @_;
    $global{tokens}->{alert} = $message;
}