in reply to CGI.pm table function memory usage

fwiw, it is a little faster if you use the OO interface.
use CGI; # ... print FH CGI->table(@rows);
this speeds up the CGI::self_or_default, which, under use CGI qw(:standard); mode, instantiates a new CGI object for each function call.

as for memory consumption, you'll have to work a row at a time..

print FH CGI->start_table; print FH @rows; print FH CGI->end_table;
(updated to clarify: it is the stringification of "@result" that CGI->table() does that is the resource killer. you can avoid that with print FH CGI->start_table, @rows, CGI->end_table;)

Replies are listed 'Best First'.
Re^2: CGI.pm table function memory usage
by isotope (Deacon) on Sep 06, 2006 at 22:19 UTC
    ...and on top of that, instead of pushing all those table rows into @rows and then printing the whole array, you can be a little bit gentler on your memory by just printing the rows as you go like this:
    print FH CGI->start_table; for(whatever){ print FH CGI->Tr(CGI->td(...)) } print FH CGI->end_table;


    --isotope