Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^4: A little overloading conundrum

by syphilis (Archbishop)
on Mar 08, 2026 at 04:38 UTC ( [id://11167420]=note: print w/replies, xml ) Need Help??


in reply to Re^3: A little overloading conundrum
in thread A little overloading conundrum

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11167420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2026-04-12 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.