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

Re: Overloading assignment

by v_o_i_d (Novice)
on Nov 25, 2004 at 05:57 UTC ( #410332=note: print w/replies, xml ) Need Help??


in reply to Overloading assignment

w00t!

Combining use overload and tie() can be done, but it requires overloading one of the scalar dereference operators (or any of the others). ie. ${}  @{}  %{} etc.

The basic idea is that you tie() self inbetween the dereferencing operation.

The only drawback is you must dereference to tie() the object (in ribbons ;). You will use it like this:

$var + 1; # use overload '+'... $$var = 'custom STORE'; # STORE() called...
Cheers buds!

Disclaimer: Use at your own risk. May not work for you like it did for me.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2021-09-18 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?