From: Ronald Fischer Date: 2007-07-02T18:32:53+09:00 Subject: Re: Accessing functions in a module without 'include' > > Sometimes I would find it more convenient to *not* inject > > the module's namespace into the user's namespace, i.e. to > > do it without the include statement. I thought it would > > be easy to qualify the foreign function with the module > > name: > > > > # Using the module in another file > > # (this does not work) > > require 'M' > > M::f(45) # Error: undefined method 'f' > > > > Maybe I'm thinking to Perlish here. Can it be done what I want > > to achieve, and how? > > Not sure if it's what you want, but if you define M as > follows it works: > > module M > def self.f(x) > .... > end > end Thank you, this works perfectly well! Ronald