$VAR = "old VAR"; $FUNC = sub {return ("old func()")}; sub show {printf "VAR='%s', func()='%s'\n", $VAR, &$FUNC()} sub redefine { local ($FUNC) = sub {return ("new func()")}; local ($VAR) = "new VAR"; show(); } show(); redefine(); show();