From: Gavin Sinclair Date: 2002-11-21T09:00:50+09:00 Subject: Re: Learning Ruby From: "Daniel Carrera" > > I noticed that Ruby doesn't let me use functions until after I define > them (unlike Perl). Why is that? I want to have the freedom to define > the functions anywhere. > > > Thanks, > Daniel. I think one trick is to do this: hello() BEGIN { def hello puts "Hi!" end } but I'm not sure :) I almost always code in classes, which tends to avoid this problem: class Example def initialize hello end def hello puts "Hi!" end end Example.new # -> Hi! Gavin