Hi,
how about:
while(@results = $dbh->dbnextrow){
print "<TR>";
foreach (@results) {
print "<TD>$_<</TD>\n";
}
print "</TR>";
}
R
At 08:19 24/09/2002 -0700, loan tran wrote:
>Hi,
>I codes in the while loop is too long. Can it be
>written in different way?
>Thanks.
>
>sub display_helpdb{
> my $server = $_[0];
> my @results;
> &sybase_connect("$server","master","sp_helpdb");
> $dbh->dbsqlexec;
> $dbh->dbresults;
> @tbl_header = ("DB Name", "DB Size", "Owner",
>"DBID", "Create Date", "Status");
> print "<table border=1><tr>";
> # contruct tbl colum header
> map{print '<th>',$_,"</th>\n"}@tbl_header ;
> print "</tr>\n";
> while(@results = $dbh->dbnextrow){
> print "<tr>
> <td> $results[0] </td>
> <td>$results[1]</td>
> <td>$results[2]</td>
> <td>$results[3]</td>
> <td>$results[4]</td>
> <td>$results[5]</td>
> </tr>";
>#is there a way to shortened the print statement above
>#I'v tried this :
># map{print "\n<tr><td>",$_[0..5],"</td></tr>\n"} @a;
># but it does not work right.
>
> }
> print "</table>";
>}#end sub
>
>__________________________________________________
>Do you Yahoo!?
>New DSL Internet Access from SBC & Yahoo!
>http://sbc.yahoo.com
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]