Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 meditating upon the Monastery: (7)
As of 2024-05-21 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found