CIW 1D0-437 CIW Perl Specialist Exam Practice Test

Page: 1 / 14
Total 169 questions

Question 1

Consider the following program code

%hash = ('small' -> 'Boz',

'medium' => '16oz',

'large' => '32oz');

@keys = sort(keys(%hash));

for ($i = 0; $i < 3; $i++) {

print('$hash{$keys[$i]}\n');

}

What is the result of executing this program code?



Answer : C

Question 2

Consider the following statement:

for ($count=0; $count < 5; $count++) {print '$count '}

What will be the output from the given statement?



Answer : D

Question 3

Consider the following program code

$i - '15';

LOOP for(; $i < 25; $i++)

{

if ($i % 2)

{

next LOOP;

}

print('$i ');

}

What is the result of executing this program code?



Answer : D

Question 4

Consider the following statement.

$buffer = a string;

Also consider that a file named test.txt contains the following 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: $!');

read(OUT, $buffer, 15, 4);

print $buffer;



Answer : B

Question 5

Consider the following program code:

$x = 5;

$y = 10;

while(++$x < 10 && ++$y < 15)

{

print ($x $y );

}

print ($x $y );

What is the result of executing this program code?



Answer : B

Page:    1 / 14   
Total 169 questions