Which one of the following choices lists valid assertions that represent places within a string?
Answer : B
Which one of the following choices uses the correct syntax for a valid array assignment?
Answer : D
Consider the following assignments:
$x = 9
$y = 7
$z = 5
Given these assignments, which one of the following expressions evaluates as true?
Answer : C
Consider the following program code:
$Animal = Dogs bark;
package Cat;
$Animal = Cats purr;
{
package Fish;
$Animal = Fish swim;
} p
ackage main;
print $Animal;
What is the result of executing this program code?
Answer : B
Consider the following program code:
$x = 10;
LOOP: while ($x < 15)
{
print ($x );
if ($x >= 14 && $x <= 20)
{
$x += 2;
redo LOOP;
}
else
{
$x++;
}
What is the result of executing this program code?
Answer : B
In Perl, packages are used for which task?
Answer : D
Consider the following program code:
@array = ("Y", "W", "X");
@array = sort(@array);
unshift(@array, "Z");
print(@array[0]);
What is the output of this code?
Answer : D
Which one of the following choices will replace all occurrences of the word perl with the word Perl?
Answer : D
Which line of code represents the correct syntax to establish a reference to a database handle?
Answer : D
Consider the following program code:
%color = (sun => yellow, apple => red);
reverse(%color);
@colorKeys = sort(keys(%color));
foreach(@colorKeys)
{
print($color{$_} . );
}
What is the result of executing this program code?
Answer : C
Which of the following correctly creates a SQL statement that will insert the values of the
$name and $age variables into a database? The statement is assigned to the $sqlStmt variable. Assume a CHAR data type for $name and an INT data type for $age.
Answer : C
Which one of the following choices is a unary operator that can apply to only a single variable?
Answer : A
Consider the following code block:
BEGIN {print ("Jan ");}
BEGIN {print ("Feb ");}
END {print ("Mar ");}
END {print ("Apr ");}
Print ("May ");
What is the result of this code block?
Answer : A
Which of the following accurately describes the roles of the Database Interface Module
(DBI) and the Database Driver Module (DBD)?
Answer : B
Consider the following program code:
1.$x = 100;
2.$y = "-25";
3.$sum = $x + $y;
4.
5.print $sum;
What is the result of executing this program code?
Answer : B