in reply to format verbose

You could use log4perl for both formatting and verbosity control
use Log::Log4perl qw(:easy); if( $verbose ){ Log::Log4perl->easy_init($TRACE); } ... TRACE("baring the foo now when the level is $TRACE");