use constant DEBUG => 0; ... if (DEBUG) { # complex logging, which disappears from the op tree }