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 following code:
$_ = "New York";
@array2 = split(//);
What is the value of $array2[0] after the code is executed?
A. ""
B. "N e w"
C. "NewYork"
D. "N"
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 program code:
@array = ("Y", "W", "X");
@array = sort(@array);
unshift(@array, "Z");
print(@array[0]);
What is the output of this code?
A. W
B. X
C. Y
D. Z
Which of the following correctly creates a SQL statement that will insert the values of the $name and $age variables into a database? The statement is assigned to the $sqlStmt variable. Assume a CHAR data type for $name and an INT data type for $age.
A. $sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};
B. $sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name\, $age)};
C. $sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};
D. $sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES (\$name\, $age)};
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
Which of the following choices demonstrates the correct syntax for creating a hash?
A. %passwds = ("denise", "robert", "yolanda") => ("pass1", "pass2", "pass3");
B. %passwds() = ("denise", "pass1", "robert", "pass2", "yolanda", "pass3");
C. %passwds = (denise=> "pass1", robert=> "pass2", yolanda=> "pass3");
D. %passwds{3} = ("denise", "robert", "yolanda") => ("pass1", "pass2", "pass3");
The filehandle INPUT is associated with the file represented by $file. Which statement will close the filehandle INPUT?
A. close (INPUT, $file);
B. closeINPUT;
C. INPUT(close, $file);
D. close(INPUT);
Consider the following code:
@cities = qw( Pittsburgh Atlanta Nashville Boston ); $city = join (":", @cities);
What is the value of $city after the code is executed?
A. PittsburghAtlantaNashvilleBoston
B. Pittsburgh, Atlanta, Nashville, Boston
C. Pittsburgh:Atlanta:Nashville:Boston
D. Pittsburgh Atlanta Nashville Boston