From: RLMuller@... (Richard) Date: 2003-09-14T18:43:07+09:00 Subject: Re: Counterpart of LINE from C++ in Ruby? Hi All, This is a great newsgroup. Thank you all for your responses. I'm using the code below, which works great for my purposes. I will look into Kernel#caller when I get a chance. I have only one minor question: I wanted to generate a blank line after my "Line x" line, so I ended my puts statement with a newline, but puts acted as it it were superfluous. I had to add \n\n to get the blank line. Bug in Ruby? --CODE def foo() puts "Subroutine foo at #{caller(0)[0]}" end puts "Line #{__LINE__}\n" foo() puts "main program at #{caller(0)[0]}" --END Regards, Richard A programmer is a device for turning coffee into code. Jeff Prosise (with an assist from Paul Erdos)