sub display_pictures { my $rowcnt = 5; my $colcnt = 5; my $total_images = $rowcnt * $colcnt; my $count = 0; my $tags_to_close = 0; # ensure all html tags are good my $stop; my $counted_in_row = 0; my $data = qq(SELECT id, filename, title FROM pictures WHERE 1); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr; print qq(
| . | ); } $stop = 1; last if $stop; } print qq($id $filename $title | \n); $count++; last if $count = $total_images; } print "