in reply to multiple conditions while loop
sub write1 { my $STH = shift; while ( @data=$STH->fetchrow_array() ) { print "<CENTER>"; print "<TR>"; print "<TD BGCOLOR='red'>"; print "<P ALIGN='CENTER'>"; print "<FONT COLOR='white'>"; } }
Alternatively, if you mean a closure that systematically goes over three previously defined statement handles, you can wrap your while loop in a foreach loop like:
sub write1 { foreach my $STH ($STH1, $STH2, $STH3) { while ( @data=$STH->fetchrow_array() ) { print "<CENTER>"; print "<TR>"; print "<TD BGCOLOR='red'>"; print "<P ALIGN='CENTER'>"; print "<FONT COLOR='white'>"; } } }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|