in reply to Re^3: Calling functions from different namespaces
in thread Calling functions from different namespaces

You could even make it default to the original s2 if the argument isn't supplied:
sub s1 { my $sub = shift || \&s2; print "s1"; $sub->(); }

Replies are listed 'Best First'.
Re^5: Calling functions from different namespaces
by Anonymous Monk on Jan 19, 2006 at 01:08 UTC
    This didn't work. It is still using the wrong s2.

      Maybe you didn't understand his suggestion: s1 is thought to call a "default" s2, which is the one defined in the same package and which happens to be -I think- the one you call "wrong". To override it, you must supply a coderef as an explicit parameter to s1 as you wrote you wanted to do in Re^2: Calling functions from different namespaces.

      See an explicit, minimal example of all this at my other reply.

        I didn't understand his suggestion. :)