Which statement will print the capital attribute of the $kansas object?
A. print ("capital"=>$kansas);
B. print {$kansas}=>(capital);
C. print (capital)<={$kansas};
D. print $kansas->{"capital"};
Consider the program code in the attached exhibit.
What is the result of executing this program code?
A. The code will output the following: 20 100 Apple Grapefruit Orange
B. The code will output the following: Apple Grapefruit Orange 20 100
C. The code will output the following: 100 20 Apple Grapefruit Orange
D. The code will output the following: Orange Grapefruit Apple 100 20
Running your Perl scripts with a w switch will perform which task?
A. Print all commands to the screen
B. Print warnings to the error.log file
C. Print check points in loops
D. Print warnings to the screen
Consider the following command:
perl runme.pl arg1 arg2 arg3
Given this command issued on the command line, what is the value of $#ARGV?
A. 0
B. 1
C. 2
D. 3
Consider the following program code: if ("cool" =~ m/[cool]{4}/) { print("True "); } else { print("False "); } if ("cool" =~ m/[col]{4}/) { print("True "); } else { print("False "); } What is the output of this code?
A. False False
B. False True
C. True False
D. True True
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?
A. The code will output the following: 1 2 3 4 5
B. The code will output the following: 2 4 1 5 3
C. The code will output the following: 2 1 3 4 5
D. The code will output the following: 2 4 1 3
Which one of the following statements uses correct syntax and expressions?
A. do (print "Hello $a") until ($a = 10);
B. do {$a++} until {$a == $b}\;
C. do {$in = $in++} while ($in < 100);
D. do ($a++) until ($b = $a);
Consider the program code in the attached exhibit.
What is the result of executing this program code?
A. The code will output the following: 3 4
B. The code will output the following: 1 2 3 4
C. The code will output the following: 1 2 4 5
D. The code will output the following: 1 2 5
Consider the following program code:
@stack = (10, 10..25); push(@stack,
yellow); shift(@stack); push(@stack,
white); print shift(@stack);
What is the result of executing this program code?
A. The code will fail at line 3 because shift requires two arguments.
B. The code will output the following: 11
C. The code will output the following: 10
D. The code will output the following: white
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?
A. The code will fail at line 4.
B. The code will output the following: Dogs bark
C. The code will output the following: Cats purr
D. The code will output the following: Fish swim