From: Robert Klemme Date: 2009-07-07T16:53:17+09:00 Subject: Re: Ruby Module 2009/7/7 Vetrivel Vetrivel : > > I have written some of the funcions in a file . The filename is test.rb > Examples > test.rb has only the  following functions . >             def hai(a,b) >                  puts "This is Hai" >             end > >             def hellow >                  puts "This is Hellow" >             end > > In check.rb I have required test.rb file . Then I used below hai method. > It works . > The check.rb file has >       require 'test' >       hai(1,2) > > When I running this program in command line it works . But I am calling > check.rb program from perl using system call . Some times it works fine > . Some time It  doesn't work . I got some error in my code . The Error > is ' Wrong no of argument  error' . >     system(check.rb). > I am running above code from perl .  To check the problem , I am > redirecting the stderr to a file . I got Wrong 'no of argument error' . > >  check.rb is an executable file . Do you have set the shebang line properly? Did you make sure that your load path is configured in a way that check.rb finds the proper test.rb? > My Solution >         I think that we should not require a file without module . I am not sure what you are trying to say here but I doubt that this will solve your issue. > I request you t share your experience . A better way to put this would have been "please share your experience". Regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/