CIW Perl Specialist 1D0-437 Exam Practice Test

Page: 1 / 14
Total 169 questions
Question 1

Consider the following lines of code:

1.$playerStr = "Today's player is Bob Petit.";

2.if($playerStr =~ /[Ruth|Gehrig|DiMaggio]/) {

3. $game = "Baseball";

4.}else{

5. $game = "Basketball";

6.}

7.print $game;

What is the output of these lines of code?



Answer : C

[Note] /[ Ruth|Gehrig|DiMaggio ]/ <=> /[ RuthGehrigDiMaggio ]/

don't confuse with /( Ruth|Gehrig|DiMaggio )/


Question 2

Consider the following program code

@array = ("Y","W"1"X");

array = sort(@ array);

unshift(@array, "Z");

print(@array[0]);

What is the output of this code?



Answer : D


Question 3

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?



Answer : C


Question 4

Which one of the following choices uses the correct syntax for a valid array assignment?



Answer : D


Question 5

Which line of code represents the correct syntax to establish a reference to a database handle?



Answer : D


Question 6

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?



Answer : B


Question 7

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?



Answer : C


Page:    1 / 14   
Total 169 questions