{ local $debug = 1; # Code here prints debugging messages # ... } # Code here reverts to the old status