Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is $PROGRAM_NAME same as $0 in ruby?

Tags:

ruby

Is $PROGRAM_NAME same as $0 in ruby?

like image 908
Neeraj Singh Avatar asked Jul 03 '09 23:07

Neeraj Singh


1 Answers

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.

like image 68
Paolo Capriotti Avatar answered Oct 20 '22 13:10

Paolo Capriotti