Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70special

CIW 1D0-437 CIW PERL FUNDAMENTALS Exam Practice Test

Page: 1 / 15
Total 149 questions

CIW PERL FUNDAMENTALS Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$37.5  $124.99

PDF Study Guide

  • Product Type: PDF Study Guide
$33  $109.99
Question 1

Consider the following program code:

@arrayA = (10, 20, 30);

@arrayB = @arrayA;

$arrayB[1] = 40;

print $arrayA[1];

What is the output of this code?

Options:

A.

10

B.

20

C.

30

D.

40

Question 2

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 3

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 4

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 5

Which of the following choices demonstrates the correct syntax for creating a hash?

Options:

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

Question 6

Consider the following command:

perl runme.pl arg1 arg2 arg3

Given this command issued on the command line, what is the value of @ARGV?

Options:

A.

arg1

B.

runme.pl

C.

arg1 arg2 arg3

D.

2

Question 7

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

Options:

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

Question 8

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 9

Consider the program code in the attached exhibit. What is the result of executing this program code?

Options:

A.

The code will output the following:

50

B.

The code will output the following:

0

C.

The code will output the following:

5

D.

The code will output the following:

multiply(5, 10)

Question 10

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 11

In Perl, packages are used for which task?

Options:

A.

To label a program

B.

To encrypt a program

C.

To create new keywords

D.

To define a namespace

Question 12

Consider the following program code:

if ("Apple" gt "Pear")

{

print("True ");

}

else

{

print("False ");

}

if ("Banana" le "Banana")

{

print("True ");

}

else

{

print("False ");

}

What is the result of executing this program code?

Options:

A.

False False

B.

False True

C.

True False

D.

True True

Question 13

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 14

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 15

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 16

Consider the following assignments:

$x = 9

$y = 7

$z = 5

Given these assignments, which one of the following expressions evaluates as true?

Options:

A.

($x - $y) != ($y - $z);

B.

($z * 2) <= $x;

C.

($y + $z + $x) = $y*3;

D.

($x 2) > $y;

Question 17

In the context of Perl user-defined subroutines, which statement is the most accurate?

Options:

A.

Variables declared using the my keyword are global in scope.

B.

Variables declared using the local keyword are only available to the subroutine from which they are declared.

C.

Variables declared using the my keyword are available to the calling subroutine.

D.

Variable declared using the local keyword are available to subsequently called subroutines.

Question 18

Which Perl debugger commands can be used to step through a script?

Options:

A.

b and d

B.

t and c

C.

s and n

D.

X and V

Question 19

Consider the following program code:

@array = (10, Masami, 10..13, Niklas);

for ($i = 1; $i < $#array; $i++)

{

print($array[$i] );

}

What is the result of executing this program code?

Options:

A.

The code will output the following:

Masami 10 11 12 13

B.

The code will output the following:

10 Masami 10 11 12 13

C.

The code will output the following:

10 Masami 11 12 13 Niklas

D.

The code will output the following:

Masami 10 11 12 13 Niklas

Question 20

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

Options:

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

Question 21

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 22

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

Page: 1 / 15
Total 149 questions