sub mymode { #... print $self->_send_headers; # print your data; $self->teardown; exit( 0 ); }