#! x:/xampp/perl/bin/perl.exe use strict; use DBI; use CGI qw/:standard/; use Benchmark qw/timethese/; my $dbh=DBI->connect("DBI:mysql:pandirecords",); my $cgi = new CGI; print $cgi->header; print $cgi->start_html('DBI & mod-perl'); print '
';
 
timethese( 10000, {
 
 inline => 'xinline',
 bind   => 'xbind',
});
print '
'; print end_html; sub xbind { my $parameter='0000284364'; my $sql = 'SELECT insured_name FROM claims WHERE ref_underwriter = ?'; my $sth = $dbh->prepare( $sql ); $sth->execute( $parameter ); my @res = $sth->fetchrow_array; } sub xinline { my $parameter='0000284364'; my $sql = 'SELECT insured_name FROM claims WHERE ref_underwriter ="' . $parameter .'"'; my $sth = $dbh->prepare( $sql ); $sth->execute; my @res = $sth->fetchrow_array; }