Summer Special Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 60certs

CIW 1D0-437 Dumps

Page: 1 / 6
Total 169 questions

CIW PERL FUNDAMENTALS Questions and Answers

Question 1

Regular expressions are best used for which task?

Options:

A.

To perform arithmetic functions

B.

To determine whether a string matches a specific pattern

C.

To perform spelling checks within text files

D.

To output data to a text file

Question 2

Which one of the following choices lists valid assertions that represent places within a string?

Options:

A.

\b, \B, \x, \X

B.

\A, \B, \Z, \G

C.

\z, \Z, \g, \y

D.

\Y, \X, \Z, \A

Question 3

Which one of the following choices is a unary operator that can apply to only a single variable?

Options:

A.

++

B.

**

C.

/

D.

?

Question 4

Consider the following lines of code:

sub mySub {

$_ = @_[1];

$a = shift;

$b = shift;

return $a * $b * $_;

}

mySub(1,2,3);

What is the output of these lines of code?

Options:

A.

No output results from this code.

B.

6

C.

2

D.

4

Question 5

Which one of the following while statements uses correct syntax and expressions?

Options:

A.

while {0} (print "OK");

B.

while ($c != 99) {print "OK"}

C.

while {$b eq "OK"} (print "$a++");

D.

while ($_) Do {print "OK");

Question 6

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?

Options:

A.

W

B.

X

C.

Y

D.

Z

Question 7

Consider the following program code:

@array = ("ALPHA", "beta", "GaMmA");

@array = sort(@array);

print("@array");

What is the output of this code?

Options:

A.

beta GaMmA ALPHA

B.

ALPHA GaMmA beta

C.

ALPHA beta GaMmA

D.

beta ALPHA GaMmA

Question 8

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);

Options:

A.

t text

20

B.

t tex

19

C.

t text

19

D.

t tex

20

Question 9

Which one of the following statements opens a file for appending?

Options:

A.

open(PASSWD, ">/etc/passwd");

B.

open(PASSWD ">/etc/passwd");

C.

open(PASSWD, ">>/etc/passwd");

D.

open(PASSWD "+>/etc/passwd");

Question 10

Which statement will print the capital attribute of the $kansas object?

Options:

A.

print ("capital"=>$kansas);

B.

print {$kansas}=>(capital);

C.

print (capital)<={$kansas};

D.

print $kansas->{"capital"};

Question 11

Consider the following program code:

1.$x = 100;

2.$y = "-25";

3.$sum = $x + $y;

4.

5.print $sum;

What is the result of executing this program code?

Options:

A.

The code will output the following:

100-25

B.

The code will output the following:

75

C.

The code will fail at line 3 because $y contains string data.

D.

The code will output the following:

125

Question 12

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

Options:

A.

@cities = Akron, Memphis, Ogden, Phoenix;

B.

@cities =~ ("Akron, Memphis");

C.

@cities =~ (Akron, Memphis, Ogden, Phoenix);

D.

@cities = ("Akron");

Question 13

Consider the following code:

$_ = "New York";

@array2 = split(//);

What is the value of $array2[0] after the code is executed?

Options:

A.

""

B.

"N e w"

C.

"NewYork"

D.

"N"

Question 14

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?

Options:

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

Question 15

Which of the following choices demonstrates the correct syntax to pass a reference to a subroutine?

Options:

A.

\@array4;

B.

@array4($ref);

C.

getpass(\@array4);

D.

getpass{@array4};

Question 16

Consider the following program code:

%employees = ("Lucy", "Accounting", "Armando", "Finance",

"Adrienne", "Marketing");

delete($employees{"Lucy"});

Which of the following lines of code has the same effect as the preceding code?

Options:

A.

%employees = ("Adrienne", "Marketing");

B.

%employees = ("Lucy", "Accounting");

C.

%employees = ("Lucy", "Accounting", "Armando", "Finance");

D.

%employees = ("Armando", "Finance", "Adrienne", "Marketing");

Question 17

Consider the following program code:

@array = ("ALPHA", "beta", "GaMmA");

@array = sort(@array);

print("@array");

What is the output of this code?

Options:

A.

beta GaMmA ALPHA

B.

ALPHA GaMmA beta

C.

ALPHA beta GaMmA

D.

beta ALPHA GaMmA

Question 18

Consider the following program code:

@array = ("ALPHA", "beta", "GaMmA");

sort(@array);

print("@array");

What is the output of this code?

Options:

A.

beta GaMmA ALPHA

B.

ALPHA GaMmA beta

C.

ALPHA beta GaMmA

D.

beta ALPHA GaMmA

Question 19

Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine getpass?

Options:

A.

getpass($arg2);

B.

call &getpass($arg2);

C.

sub &getpass($arg2);

D.

call getpass($arg2);

Question 20

Consider the following program code:

1.$x = 100;

2.$y = 15;

3.$result = $x % $y;

4.

5.print $result;

What is the result of executing this program code?

Options:

A.

The code will fail at line 3 because % is a unary operator.

B.

The code will output the following:

10E+16

C.

The code will output the following:

10

D.

The code will fail at line 5 because $result is not enclosed by parentheses.

Question 21

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?

Options:

A.

one

B.

two

C.

three

D.

four

Question 22

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?

Options:

A.

The code will output the following:

apple sun

B.

The code will output the following:

sun apple

C.

The code will output the following:

red yellow

D.

The code will output the following:

apple red sun yellow

Page: 1 / 6
Total 169 questions