Damian Conway:
# Larry Wall wrote:
# > On Mon, Nov 18, 2002 at 08:05:47AM +1100, Damian Conway wrote:
# > : I still think my original:
# > : 
# > :   sub bar(; $foo = $topic) is given($topic) {...}
# > :
# > : is the appropriate compromise.
# > 
# > Won't fly.  Referring to something lexical before it's 
# declared is a 
# > no-no.
# >     sub bar(*@args = $<mumble>) {...}       # default to [$_]
# >     sub bar(*@args = @$<mumble>) {...}      # default to @$_
# > 
# > What <mumble> might be is an interesting, er, topic.
# 
# I would argue it ought to be just $_, which is, after all,
# the One True Topic. And conveniently lexically predeclared in 
# all scopes.

I prefer $CALLER::_ ("CALLER:: - access caller's lexical variables, then
globals").  I'd expect that you could use the same thing for other
variables, e.g. $CALLER::some_lexical.  Of course, the can of worms that
opens is horrifying to consider (and no longer has the benefit of the
ugly caller.MY).  :^)

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)

Reply via email to