From: Bob Gustafson Date: 2001-09-18T13:17:03+09:00 Subject: [ruby-talk:21302] Re: nested require files need path internally On Tue, 18 Sep 2001, David Alan Black wrote: >Hello -- > >On Tue, 18 Sep 2001, Bob Gustafson wrote: > >> -- Perhaps the 'require' file processing should first look for a file in the >> local directory with the exact name given, then if a file is not found, >>go to >> the system directory to look for a file with the same basename and .rb >> extension? > >'require' will look in the order specified in the $: global variable >By default, "." is the last element in $:. If you want, you can do: > > $:.unshift $:.pop > >to move it to the front. You could also do: > > require "./date" > Thanks much - at least there is some logic. However, this default file lookup ordering seems to be the reverse of what is expected from other languages. A surprise !! At least for me. BobG