Consider the following program code:
@arrayA = (10, 20, 30);
@arrayB = @arrayA;
$arrayB[1] = 40;
print $arrayA[1];
What is the output of this code?
Answer : B
Which one of the following while statements uses correct syntax and expressions?
Answer : B
Karl wants to define a character class that includes any alphanumeric word characters. Which of the following choices is best suited for this requirement?
Answer : A
Consider the following program code
%hash = ("small" -> "Boz",
"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?
Answer : C
Consider the following program code:
@array = ("ALPHA", "beta", "GaMmA");
@array = sort(@array);
print("@array");
What is the output of this code?
Answer : B
Consider the following program code:
$var = 10;
package Alpha;
$var = 20;
{
package Beta;
$var = 30;
}
package Gamma;
$var = 40;
{
print $var;
}
What is the output of this code?
Answer : D
Consider the following program code:
$x = 150;
$y = "250";
if (($x + 100) == $y) { print("1 "); }
if ("250" == $y) { print("2 "); }
if ("250" eq $y) { print("3 "); }
if ($x lt $y) { print("4 "); }
if ($x ge $y) { print("5 "); }
What is the result of executing this program code?
Answer : A