On Mon, Aug 27, 2001 at 06:02:50PM -0500, Garrett Goebel wrote:
> From: Ken Fox [mailto:[EMAIL PROTECTED]]
> > 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*

That's what 'or' means.


> 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...

A good redirector should be totally transparent.  When _foo() asks for
it's caller() it should get foo()'s caller, not foo() itself.

So in this case, goto does the right thing.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
You see, in this world there's two kinds of people.  Those with loaded
guns, and those who dig.  Dig.
                -- Blonde, "The Good, The Bad And The Ugly"

Reply via email to