Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Reblessing (was: OO Perl: calling a constructor within a class)

by dragonchild (Archbishop)
on Sep 27, 2001 at 17:39 UTC ( [id://115088]=note: print w/replies, xml ) Need Help??


in reply to Reblessing (was: OO Perl: calling a constructor within a class)
in thread OO Perl: calling a constructor within a class

*shudders at the thoughts of his objects doing the can('can')*

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

  • Comment on Re: Reblessing (was: OO Perl: calling a constructor within a class)

Replies are listed 'Best First'.
Re (tilly) 2: Reblessing (was: OO Perl: calling a constructor within a class)
by tilly (Archbishop) on Sep 27, 2001 at 21:05 UTC
    Were you thinking something like this?
    Objects can always can, but a special can can can the usual can. But to see it's a special can you can:
    $check_that_can_with = UNIVERSAL::can($obj,'can') ne \&UNIVERSAL::can;
    But you can't catch the man who replaced the default can:
    my $can = \&UNIVERSAL::can; local $^W = 0; *UNIVERSAL::can = sub { $_[1] eq 'can' ? \&UNIVERSAL::can : &$can; };
    So can that man before he cans your can!
    (Sorry)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-24 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found