package Some::Thing; ... if( ::DEBUG ) { ## do debug stuff } #### use constant DEBUG => 1; ## set to 0 to disable debug and have debug guarded code optimised away use Some::Thing; ...