in reply to [Solved]: Can we use print <<HTML; twice in same file?

It's a Bad Idea to mix languages in a program. You have CSS inside HTML inside Perl ... it would make your life a lot easier to separate them out. Please look at Template::Tiny or another templating engine.

At the very least, create your own package to contain all that HTML-producing code, or at the very very least, put the code in subs so the HTML is removed from your main program flow. E.g.:

while (my @row = $sth->fetchrow_array) { print ivr_call( $row[5] ); print non_outage_call( $row[6] ); } sub ivr_call { my $checked = shift eq '1' ? 'checked' : ''; return "<td><form><input type='checkbox' name='ivr_call' value='1' $ +checked>IVR Call Volume</form></td>"; } sub non_outage_call { my $checked = shift eq '1' ? 'checked' : ''; return "<td><form><input type='checkbox' name='non_outage_call' valu +e='1' $checked>Non-Outage Call Volume</form></td>"; }
The way forward always starts with a minimal test.