From: Quintus Date: 2011-03-07T06:46:25+09:00 Subject: Re: ruby script Am 06.03.2011 21:45, schrieb Mlle: > Hi, > > I wrote a ruby script but I'd like to define a method within it and > call the method from the main method. How do I do that? Do I have to > define the whole file as a module or something? > Thanks > > Ruby doesn't have a main method. Your script starts being executed at the very top and ends at the very bottom. Everything in between is executed line by line. How about: ==================== def mymethod puts "Hello from my method!" end mymethod ==================== ? Vale, Marvin