Which one of the following choices lists valid assertions that represent places within a string?
Which one of the following choices is a unary operator that can apply to only a single variable?
Consider the following lines of code:
sub mySub {
$_ = @_[1];
$a = shift;
$b = shift;
return $a * $b * $_;
}
mySub(1,2,3);
What is the output of these lines of code?
Which one of the following while statements uses correct syntax and expressions?
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?
Consider the following program code:
@array = ("ALPHA", "beta", "GaMmA");
@array = sort(@array);
print("@array");
What is the output of this code?
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);
Which one of the following statements opens a file for appending?
Which statement will print the capital attribute of the $kansas object?
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?
Which one of the following choices uses the correct syntax for a valid array assignment?
Consider the following code:
$_ = "New York";
@array2 = split(//);
What is the value of $array2[0] after the code is executed?
Consider the following program code:
$Animal = Dogs bark;
package Cat;
$Animal = Cats purr;
{
package Fish;
$Animal = Fish swim;
}
package main;
print $Animal;
What is the result of executing this program code?
Which of the following choices demonstrates the correct syntax to pass a reference to a subroutine?
Consider the following program code:
%employees = ("Lucy", "Accounting", "Armando", "Finance",
"Adrienne", "Marketing");
delete($employees{"Lucy"});
Which of the following lines of code has the same effect as the preceding code?
Consider the following program code:
@array = ("ALPHA", "beta", "GaMmA");
@array = sort(@array);
print("@array");
What is the output of this code?
Consider the following program code:
@array = ("ALPHA", "beta", "GaMmA");
sort(@array);
print("@array");
What is the output of this code?
Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine getpass?
Consider the following program code:
1.$x = 100;
2.$y = 15;
3.$result = $x % $y;
4.
5.print $result;
What is the result of executing this program code?
Consider the following program code:
@array = ("one", "two");
push(@array, "three");
shift(@array);
unshift(@array, "four");
pop(@array);
print($array[0]);
What is the output of this code?
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?