Which of the following choices demonstrates the proper way to close a database connection given that$dbh is the database handle?
Consider that a file named test.txt contains this line of text:
One line of test text What is the output of the following lines of code?
$file = "test.txt";
open (OUT, "<$file") || (die "cannot open $file: $!");
seek(OUT, 15,0);
read(OUT,$buffer, 5);
print $buffer. "\n";
print tell(OUT);
Assume $sth is a valid statement handle. Which of the following correctly outputs the data from
the first three columns of a result set?
Consider the following program code:
$y=l; $x = 2; $z = 3;
do
{
print ($y); } while ($y eq 2);
do
{
print ($x); } until ($x eq 2);
print ($z);
What is the result of executing this program code?
Consider the following program code:
%hash = (small => 8oz,
medium => 16oz, large => 32oz);
@keys = sort(keys(%hash));
for ($i = 0; $i < 3; $i++) {
print($hash{$keys[$i]}\n);
}
What is the result of executing this program code?