From: Tim Bates Date: 2003-03-09T16:59:35+09:00 Subject: $0 == false ?? I'm running a script under mod_ruby, and for some reason $0 is set to false. Two questions, then: Why would it be false, instead of 'myscript.rb'? Has mod_ruby clobbered it? Without $0, how can I retrieve the name of the currently running script from within a require'd file? (ie, __FILE__ won't work...) Example: tim@zaphod:~$ cat a.rb require 'b.rb' tim@zaphod:~$ cat b.rb puts "$0 == #{$0}" puts "__FILE__ == #{__FILE__}" tim@zaphod:~$ ruby a.rb $0 == a.rb __FILE__ == ./b.rb tim@zaphod:~$ In b.rb, I want to retrieve the value 'a.rb', so __FILE__ is no good, but if $0 has been clobbered, what can I do? Tim Bates -- tim@bates.id.au