use strict; use warnings; # turn on all warnings sub recurse { no warnings 'recursion'; # turn off recursion warnings # in this block _only_ # do recursive processing return $something; } # all warnings back on, since you are outside of the # scope where no warnings 'recursion' was set.