##
sub foo {
no warnings 'redefine';
local *foo = sub {
... ;
... foo(...) ...;
... ;
};
return foo(@_);
}
##
##
use vars qw/ $REC /;
sub foo {
local $REC = sub {
... ;
... $REC->(...) ...;
... ;
};
return $REC->(@_);
}
##
##
sub foo {
no warning 'redefine'; # needed if the recursive sub calls any other sub
local *_ = sub {
... ;
... _(...) ...;
... ;
};
return _(@_);
}