in reply to Scope and Context
I think doing this sort of thing is fantastic. You end up doing far less pushing and popping of stuff from the stack.
Additionally, I've found that:
sub foo { ... $_[0] = $obj goto scalar $_[0]->can("method"); }
Doesn't involve the same amount of stack work as:
sub foo { ... $obj->(@_[1..$#_]); }
Bad style? Perhaps. But necessary for any real speed until the optimising compiler in Perl 6 does things like the above for you.
|
|---|