#!/usr/bin/perl # use CGI qw(:all *table); use CGI::Carp qw(fatalsToBrowser); use DBI; use filmdb; # in ~dcw/public_html alongside this script my $dbh = opendb( ); my $sth = $dbh->prepare( "select * from films" ); $sth->execute || die; print header, start_html( -bgcolor => "#FFFFFF", -title => "Films Example in Perl CGI" ), "\n", start_table( { -border => 1 } ); while( my @row = $sth->fetchrow_array ) { my( $title,$director,$origin,$made,$length ) = @row; print "\n", Tr( th( {-align=>"left"}, $title ), td( $director ), td( $origin ), td( $made ), td( $length ) ); } print "\n", end_table; $sth->finish(); print "\n", end_html; closedb(); exit 0;