Odd feature of perl5:

    sub bar { &foo }
    sub foo { print @_ }

    print bar("It's Mmmmmaaaaagic!");

When foo() is called as &foo with no parens and no arguments, it
inherits @_ from it's caller.

This might have been originally introduced as an efficient way to pass
huge sets of arguments without copying before references were
introduced, but that's not a problem anymore.  foo(@_) or goto &foo
works just fine.

I can't think of any reason why this feature is useful anymore, and it
can be a really confusing behavior, so what say we kill it in Perl 6?


-- 

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