From: "Guy N. Hurst" Date: 2002-01-20T08:31:31+09:00 Subject: Re: $_ as default parameter for a function HarryO wrote: > > On Sun, 20 Jan 2002 09:42:41 +1100, HarryO wrote: > > > On Sun, 20 Jan 2002 07:27:41 +1100, Thomas wrote: > > > > > >> How do I write a function that uses the value of $_ in the calling > >> scope, so I can get the same behaviour as the many Kernel methods. > > > > While I don't have an answer to the specific question, it seems to me > > that talking about scope for $_ doesn't make sense, since it's a global. > > In fact, it is not a global, although it is a built-in. This whole issue came up before, and matju devised a clever hack to actually access the value of $_ (matju, comment?) But to those of you who know Perl, $_ in Ruby is not exactly the same thing, as is once again being discovered here... Guy N. Hurst