my $json = JSON->new->utf8->encode($data); my $q = $self->query; print $q->header( -type => 'application/json', -charset => 'utf-8', ); print $json; $self->session->flush if $self->can('session') && $self->session_loaded; # Absolutely murder the rest of the call stack exit; # OR die if mod_perl yells at exit()