avarus has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
OK, this should be dead easy but every permutation I try throws an error.
Slightly cleaned up version is that I have a class 'bar' which ISA 'foo' and I call the method 'dostuff', but under certain conditions I want to delegate to the superclass:
But I cannot summon the correct syntax. Any ideas?
Thanks,
TIM
OK, this should be dead easy but every permutation I try throws an error.
Slightly cleaned up version is that I have a class 'bar' which ISA 'foo' and I call the method 'dostuff', but under certain conditions I want to delegate to the superclass:
That works, but I really want to say:#in package bar sub dostuff { return $_[0]->SUPER::dostuff() if $condition; }
IE - clean up the stack and continue as if the method in the subclass never existed.sub dostuff { goto &{ $_[0]->SUPER::dostuff } if $condition; }
But I cannot summon the correct syntax. Any ideas?
Thanks,
TIM
-- #Tip: use 'no strict' to make those nasty errors vanish.
Back to
Seekers of Perl Wisdom