Sherlock has asked for the wisdom of the Perl Monks concerning the following question:
The second piece of code I've written uses block printing and looks like this:#Print the data onto the screen print table({-border=>1}, Tr( td({-valign=>'top'}, table({-border=>1}, Tr(td(center('Days with Appointments:'))), Tr(td(center( $query->scrolling_list( -NAME => "daysList", -VALUES => [keys %calendar], -SIZE => 5, -MULTIPLE => 0,) ) ) ), Tr(td(center( $query->submit({-name=>'dateSelectionButton', -value=>'Dis +play Appts'}) ) ) ) ) ), td({-valign=>'top'}, table({-border=>1}, Tr(td(center('Appointments:'))), Tr(td(center( $query->scrolling_list( -NAME => "apptsList", -VALUES => \@apptTimeList, -SIZE => 5, -MULTIPLE => 0,) ) ) ) ) ) ) );
As far as I can tell, these two bits of code work identically. The only question I have is which one is going to be easier to maintain. Personally, I'm able to read the second bit easier so I would feel that this would be the easiest to maintain, but so often, I hear monks exclaim "USE CGI.pm!" Is there something I'm missing that would make the first portion of code easier to maintain later?print <<StartTable; <TABLE BORDER="1"> <TR> <TD VALIGN="top"> <TABLE BORDER="1"> <TR> <TD><CENTER>Days with Appointments:</CENTER></TD> </TR> <TR> <TD><CENTER> StartTable print $query->scrolling_list( -NAME => "daysList", -VALUES => [keys %calendar], -SIZE => 5, -MULTIPLE => 0, ); print <<MidTable; </CENTER></TD> </TR> <TR> <TD><CENTER><INPUT TYPE="SUBMIT" VALUE="Display Appts"></C +ENTER></TD> </TR> </TABLE> </TD> <TD VALIGN="top"> <TABLE BORDER="1"> <TR> <TD><CENTER>Appointments:</CENTER></TD> </TR> <TR> <TD><CENTER> MidTable print $query->scrolling_list( -NAME => "apptsList", -VALUES => \@apptTimeList, -SIZE => 5, -MULTIPLE => 0, ); print <<EndTable; </CENTER></TD> </TR> </TABLE> </TD> </TR> </TABLE> EndTable
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Interactive Form Creation/Maintenance
by Sifmole (Chaplain) on May 09, 2001 at 21:20 UTC | |
Re: Interactive Form Creation/Maintenance
by buckaduck (Chaplain) on May 09, 2001 at 21:47 UTC | |
Re: Interactive Form Creation/Maintenance
by sutch (Curate) on May 09, 2001 at 20:47 UTC | |
Re: Interactive Form Creation/Maintenance
by Sherlock (Deacon) on May 10, 2001 at 00:18 UTC | |
Re: Interactive Form Creation/Maintenance
by Sifmole (Chaplain) on May 09, 2001 at 20:50 UTC | |
by Sherlock (Deacon) on May 09, 2001 at 22:57 UTC | |
Re: Interactive Form Creation/Maintenance
by markjugg (Curate) on May 09, 2001 at 23:28 UTC | |
Re: Interactive Form Creation/Maintenance
by HamNRye (Monk) on May 10, 2001 at 23:08 UTC |