in reply to Why isn't ->can() curried?
Would the behaviour be something like this
HTH
Or something else perhaps?use strict; use warnings; { my $old_can = *UNIVERSAL::can{CODE}; no warnings 'redefine'; *UNIVERSAL::can = sub { my($class,$method) = @_; my $ret = $old_can->($class, $method); return sub { warn "$class->$ret( @_ )\n"; $class->$ret( @_ ) }; }; } sub foo::bar { print "got: @_[1 .. $#_]\n"; } my $m = foo->can("bar"); $m->(qw(ichi ni san shi)); __output__ foo->CODE(0x81080f8)( ichi ni san shi ) got: ichi ni san shi
HTH
_________
broquaint
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why isn't ->can() curried?
by diotalevi (Canon) on Jan 20, 2003 at 18:08 UTC | |
by Elian (Parson) on Jan 20, 2003 at 18:23 UTC |
In Section
Seekers of Perl Wisdom