Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Subverting overload

by Zaxo (Archbishop)
on Nov 29, 2004 at 03:05 UTC ( [id://410851]=note: print w/replies, xml ) Need Help??


in reply to Subverting overload

The ref function will tell you what class you're blessed into, if that's what you want.

package Foo; use overload '""', sub {"Hello, World!"}; package main; my $foo = bless {}, 'Foo'; { local $, = ' '; print $foo, ref($foo), $/;</p> }
Otherwise, you'll probably want to rebless into another class without the overloaded stringification. I can't think of a way to completely unbless an object.

UpdateL BrowserUK++, I completely forgot about that.

After Compline,
Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2025-06-12 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.