Consider the following program code:
@arrayA = (10, 20, 30);
@arrayB = @arrayA;
$arrayB[1] = 40;
print $arrayA[1];
What is the output of this code?
Which of the following choices demonstrates the correct syntax to pass a reference to a subroutine?
Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine getpass?
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 of the following choices demonstrates the correct syntax for creating a hash?
Consider the following command:
perl runme.pl arg1 arg2 arg3
Given this command issued on the command line, what is the value of @ARGV?
Which one of the following statements uses correct syntax and expressions?
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?
Consider the program code in the attached exhibit. What is the result of executing this program code?
Which one of the following choices uses the correct syntax for a valid array assignment?
In Perl, packages are used for which task?
Consider the following program code:
if ("Apple" gt "Pear")
{
print("True ");
}
else
{
print("False ");
}
if ("Banana" le "Banana")
{
print("True ");
}
else
{
print("False ");
}
What is the result of executing this program code?
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:
%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");
sort(@array);
print("@array");
What is the output of this code?
Consider the following assignments:
$x = 9
$y = 7
$z = 5
Given these assignments, which one of the following expressions evaluates as true?
In the context of Perl user-defined subroutines, which statement is the most accurate?
Which Perl debugger commands can be used to step through a script?
Consider the following program code:
@array = (10, Masami, 10..13, Niklas);
for ($i = 1; $i < $#array; $i++)
{
print($array[$i] );
}
What is the result of executing this program code?
Which one of the following statements uses correct syntax and expressions?
Which one of the following choices uses the correct syntax for a valid array assignment?
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?