From: daz Date: 2003-09-14T02:21:06+09:00 Subject: Re: Counterpart of __LINE__ from C++ in Ruby? "RLMuller" wrote: Hi All, Does Ruby offer a global variable like $. or a global method that provides the line-number in which it appears as opposed to the last line scanned by Ruby? I've assembled a large script of examples from various Ruby web sites, which in turn produces a lot of output. It'd be nice if I could just paste in puts "#{$something}" at various points so that a reader perusing a portion of the output could easily locate the source code that generated it. puts __LINE__ # stuff puts __LINE__ # I must not post in HTML puts __LINE__ #-> 1 #-> 3 #-> 5 daz