|
|
| go ahead... be a heretic | |
| PerlMonks |
Re^4: A little overloading conundrumby syphilis (Archbishop) |
| on Mar 08, 2026 at 04:38 UTC ( [id://11167420]=note: print w/replies, xml ) | Need Help?? |
|
If you are working around it in the caller... Apologies - I should have explicitly stated that "working around it in the caller" is not a solution. It's imperative that, wrt the given pseudo-example, my $n2 = $B_obj - $A_obj; return a module A object with a value of -10. Hence my agreement with sw1's labelling of both his and my alterations to the caller as being "not practical". If module B did not overload the '-' operator then, AIUI, my $n2 = $B_obj - $A_obj; would invoke module A's overloading of that operator - which is exactly what I want. I was hoping there might have been some way of triggering that same behaviour when module B does overload that operator .... but it seems that's not the case. Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||