From: Rudolf Polzer Date: 2003-09-14T02:21:08+09:00 Subject: Re: Counterpart of __LINE__ from C++ in Ruby? Scripsit illa aut ille �RLMuller� : > 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? def foo() puts "foo() at #{caller(0)[0]}" end foo() puts "main program at #{caller(0)[0]}" BTW, it works exactly the same way as in Perl, just better (also reporting correct values when called from the main program, not only from subroutines). -- The only thing that Babelfish is good at is proving that Vogons are great poets. Josef 'Jupp' Schugt in japan.anime.evangelion