#!/usr/local/bin/perl5_8 use strict; use ncw_com_library; # contains common subs (commify, timeout, etc.) use HTML::Template; use Time::Local; use DBI; use CGI ':standard'; my $CGI = CGI->new; # Clear buffers and set up web page (required) $|=1; open STDERR, ">&STDOUT"; # SNIP there are ~25,000 unique keys in my control table and I have snipped # out the SQL and database calls that generate my control table dataset for # those since they are returning results in a timely fashion based on # timestamps printed while fetching and executing SQL. my ($key, %col_cbud, %col_encu, %col_fytd, %col_proj, %ctrl_tbl, @loop_data); foreach $key ( sort keys %ctrl_tbl ) { my %row_data; # Gimme a timestamp so I can see how long each row takes my ( $sec1,$min1,$hour1,$mday1,$mon1,$year1,$wday1,$yday1,$isdst1 ) = localtime; print "during foreach loop hour min sec $hour1 $min1 $sec1 xxx key is $key
"; $row_data{col_proj} = $key; $row_data{col_cbud} = $col_cbud{$key}; $row_data{col_fytd} = $col_fytd{$key}; $row_data{col_encu} = $col_encu{$key}; # Add each hash row to loop for template push(@loop_data, \%row_data); } # Pass parameters and variable values from @loop arrays to template; print report $template->param( passdata => \@loop_data, ); print $template->output();