From: Ken Fox [mailto:kfox@vulpes.com]
> Michael G Schwern wrote:
> > Any time you want to implicitly pass @_, you can just as easily
> > *explicitly* pass it or use goto.
goto does screw up caller... so I wouldn't say *anytime*
> I never thought of using goto actually. "goto &$method;" actually
> looks clearer than the code I'm using. (Although with re-directors
> we want to minimize cost so the 10% penalty should be eliminated.)
sub foo { &{ $_[0]->{_foo} || $_[0]->can(_foo) } }
works just as well as
sub foo { goto &{ $_[0]->{_foo} || $_[0]->can(_foo) } }
and doesn't mess up code which relies on caller...
Thread Previous
|
Thread Next