From: Philip Mak Date: 2002-08-11T09:34:22+09:00 Subject: Re: extend Html4? On Sun, Aug 11, 2002 at 09:16:01AM +0900, dblack@candle.superlink.net wrote: > You can include the module, but keep reading below.... > > require 'cgi' > include CGI::Html3 > cgi = CGI.new("html3") > puts html { h1 { "hi" } } Hmm, it's a little weird that the html, h1, etc. methods won't work until CGI.new has been called. Is it considered bad programming practice to make use of a module that's defined inside someone else's class? > For reasons I haven't fully looked into, this doesn't print the > DOCTYPE declaration; it just prints: > >

hi

> > so it's probably treading where it shouldn't. But maybe it could > point you in the right direction (if there is one :-) I'm guessing it's because when you call "html" instead of "cgi.html", it fails to find something on self that would be present if self was a true CGI object.