From: Mark Bilk Date: 2009-04-11T03:17:31+09:00 Subject: Re: Calling a Function Before It's Defined Mark Bilk wrote: > here's the fixed version of my code: > ------------------- > s = "abc" > f(s) > > BEGIN { > def f(x) > print('f: ', x, "\n") > end > } > ------------------- A friend thought of another way, that avoids even the BEGIN hack: def mainn s = "abc" f(s) end def f(x) print('f: ', x, "\n") end mainn ------------------- -- Posted via http://www.ruby-forum.com/.