Objects can always can, but a special can can can the usual can. But to see it's a special can you can:(Sorry)But you can't catch the man who replaced the default can:$check_that_can_with = UNIVERSAL::can($obj,'can') ne \&UNIVERSAL::can;So can that man before he cans your can!my $can = \&UNIVERSAL::can; local $^W = 0; *UNIVERSAL::can = sub { $_[1] eq 'can' ? \&UNIVERSAL::can : &$can; };
In reply to Re (tilly) 2: Reblessing (was: OO Perl: calling a constructor within a class)
by tilly
in thread OO Perl: calling a constructor within a class
by fx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |