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 "
IVR Call Volume
"; } sub non_outage_call { my $checked = shift eq '1' ? 'checked' : ''; return "
Non-Outage Call Volume
"; }