Which one of the following choices will replace all occurrences of the word perl with the word Perl?
Which of the following choices demonstrates the correct syntax to pass a reference to a subroutine?
Which one of the following statements uses correct syntax and expressions?
Consider the following code:
%chars = ("a", "100", "b", "90", "c", "80");
Which one of the following choices will reverse the key/value pairing of the code?
Consider the following program code:
$y = 1;
$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 lines of code:
sub mySub {
($arg, @args) = @_;
foreach $val (@args) {
$returnVal .= "$arg, $val\n";
}
$returnVal . "" . @args;
}
print &mySub(1, "a value", "another value", "a parameter", "another parameter");
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?
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);
Consider the following program code:
print(1 );
BEGIN { print(2 ); }
END { print(3 ); }
BEGIN { print(4 ); }
END
{
package MyPackage;
print(5 );
}
What is the result of executing this program code?
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?
Which statement is the most accurate?
Consider the following program code:
@arrayA = (10, 20, 30);
@arrayB = @arrayA;
$arrayB[1] = 40;
print $arrayA[1];
What is the output of this 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:
$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?
Regular expressions are best 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?
In the context of Perl user-defined subroutines, which statement is the most accurate?
Consider the following lines of code:
$_ = "This is a test";
s/^([^ ]*)\s*([^ ]*)/$2 $1/;
print;
What is the output of these lines of code?
Which of the following tasks is the least effective in reducing errors in Perl scripts?
In Perl, packages are used for which task?
Yngve wants to define a character class that includes any alphanumeric word characters. Which one of the following choices is best suited for this requirement?
Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine getpass?