On Thu, Aug 09, 2001 at 01:41:00PM +0100, ruby-talk / ruby-lang.org wrote: > >>>>> "R" == Renald Buter <buter / CWTS.LeidenUniv.nl> writes: > > R> Of course I could always assign to $_, but would this assignment be > R> local to the current scope? > > What do you call current scope ? > > $_ is a local, and thread local, variable. > > > Guy Decoux By local I meant block-local, e.g. for ($bla) { # $_ == $bla for ($foo) { # $_ == $foo } # $_ == $bla, again } Looking back at my question, I see it is a bit fuzzy. What I am really looking for is a case-like structure _with_ fall-through, but _without_ having to write down the variable name for each regexp test. Thus, NOT if bla =~ /help/ then help; end if bla =~ /help_more/ then help_more; end if bla =~ /help_even_more/ then help_even_more; end BUT (perlesque denotation) bla = "help_more" for bla # $_ is now equal to bla ("help_more") /help/ and help /help_more/ and help_more /help_even_more/ and help_even_more end # $_ is now nil See what I mean? Regards, Renald