From: Logan Capaldo Date: 2006-12-29T03:29:58+09:00 Subject: Re: Last Used Object On Fri, Dec 29, 2006 at 12:10:08AM +0900, Phrogz wrote: > Marc Heiler wrote: > > Does "normal" ruby have this as well, or > > is this IRB specific? > > It's easier, I think, to find out yourself than it is to ask the > question :) > > slim:~ gavinkistner$ ruby -e "a=10;p _" > -e:1: undefined local variable or method `_' for main:Object (NameError) > OTOH, there is the (evil) perlesque $_. ruby -e 'gets and print $_' Of course this is not the same thing, and it's set but a group of methods, not automatically every time. e.g.: ruby -e '7; p $_'