tags:

views:

183

answers:

1

Is $PROGRAM_NAME same as $0 in ruby?

+12  A: 

From ruby 1.8's code in svn trunk:

rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);

So, yes, they should be the same.

Paolo Capriotti