use if ! $MODE eq 'PRODUCTION', warnings; #### { no warnings 'warning type'; # Code that generated the useless warning here }