--- cpp layer class perlwrapper_button public Button{ virtual void buttonclick(){ if ( !call perl->this_instance->buttonclick() ){ Button::buttonclick(); // Call tvision's buttononclick } } } --- perl module package Button; sub buttonclick{ return 0; } 1; --- The perl code of mybutton: package MyButton; push @ISA, 'Button'; sub buttonclick{ exit(0); } 1;