err, I humbly and abjectly withdraw my comments below. (I should have checked the error message in the error_log when it failed after manually including the second file's contents in the eruby file.) -pate <-- note the penitent set of the signature On Tue, 5 Feb 2002, Pat Eyler wrote: > On Tue, 5 Feb 2002, Sean Chittenden wrote: > > > You need to declare cgi in your included file... that or you need to > > include your file, then pass cgi as an argument. > > hmm, it's not actually a seperate function or object. I made the > #include-like assumption that if I were writing something procedural (I > know, I'm a heretic) that the code from the 'require'd file would just be > set in place and executed in the normal flow of traffic. > > > Something tells me your background is in PHP, yes? ;~) > > not really, I've done a bit of perl, a bit of php, and a (tiny) little > bit of C, but mostly shell stuff. > > > Ruby/eRuby is much more like a > > normal programming language in that its got sane scopping and > > namespace pragma. -sc > > I don't understand how scoping would affect this. If I just add the code > into the eruby file it would look like (by the way this doesn't work on > the production machine either): > ============ > require 'cgi' > > cgi = CGI.new("html3") > > if (cgi['process']) > ## begin 'require'd file > > date = cgi['date'] # this doesn't work when it lives in a > # different file or in the eruby file > # process the date to make ensure it fits our defined format > # write the date and other POSTed data into a file > > ## end 'require'd file > > else > > # create a form to gather the required data > > end > ============ > > Just for clarity, I built ruby and eruby from the same tarballs for both > machines. I'd be happy to dig more information out as needed. > > thanks, > -pate > > > > > > > >