geektron has asked for the wisdom of the Perl Monks concerning the following question:
i have a script that instantiates display objects, then prints out the results. let's call it index.cgi
index.cgi basically does this:
not much processing there.my $page = DisplayModule->new(); my $html = $page->build_page; print $page;
the display module makes some decisions about what page to build, then build them, collecting all of the HTML ( to be later printed by index.cgi )
one of the methods in DisplayModule ( that gets called by the build_page routine ) needs to print some 'status messages' out to the screen before the HTML is rendered. but the print statements live in another module, let's call it Debugger.pm
so in DisplayModule->build_page, an new Debugger is created. something like this:
sub build_page { my $self = shift; #### the usual arg processing, etc my $debug = Debugger->new(); $debug->debug_it(); ### gather up more info, stick it into the $html var return $html; }
is there something i'm overlooking?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unbuffering I/O with objects
by dws (Chancellor) on Mar 23, 2001 at 10:05 UTC | |
by geektron (Curate) on Mar 23, 2001 at 13:49 UTC | |
by merlyn (Sage) on Mar 23, 2001 at 16:40 UTC | |
by geektron (Curate) on Mar 24, 2001 at 00:39 UTC |