Write an ‘alert’ helper 

sub alert {
    my($message, %opt) = @_;

    my $span = 'span' . ($opt{span} || '12');
    $span   .= ' offset' . $opt{offset} if $opt{offset};
    $global{tokens}->{alert}       = $message;
    $global{tokens}->{alert_span}  = $span;
    $global{tokens}->{alert_type}  = 'alert-' . ($opt{type} || 'error');
}