Skip to main content

1D0-437 Real Exam Questions

CIW PERL FUNDAMENTALS

149 questions available · Page 1 of 15

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

Consider the following program code:

print(1 );

BEGIN { print(2 ); }

END { print(3 ); }

BEGIN { print(4 ); }

END

{

package MyPackage;

print(5 );

}

What is the result of executing this program code?

  1. A

    The code will output the following:
    1 2 3 4 5

  2. B

    The code will output the following:
    2 4 1 5 3

  3. C

    The code will output the following:
    2 1 3 4 5

  4. D

    The code will output the following:
    2 4 1 3

Show answer and explanation

Correct answer: B

Question 2 Single choice

Consider the program code in the attached exhibit.

What is the result of executing this program code?

  1. A

    The code will output the following:
    20 100 Apple Grapefruit Orange

  2. B

    The code will output the following: Apple Grapefruit Orange 20 100

  3. C

    The code will output the following:
    100 20 Apple Grapefruit Orange

  4. D

    The code will output the following: Orange Grapefruit Apple 100 20

Show answer and explanation

Correct answer: B

Question 3 Single choice

The filehandle INPUT is associated with the file represented by $file.

Which statement will close the filehandle INPUT?

  1. A

    close (INPUT, $file);

  2. B

    closeINPUT;

  3. C

    INPUT(close, $file);

  4. D

    close(INPUT);

Show answer and explanation

Correct answer: D

Question 4 Single choice

Consider the following code block:

BEGIN {print ("Jan ");}

BEGIN {print ("Feb ");}

END {print ("Mar ");}

END {print ("Apr ");}

Print ("May ");

What is the result of this code block?

  1. A

    Jan Feb May Apr Mar

  2. B

    Jan Feb Mar Apr May

  3. C

    Mar Apr May Jan Feb

  4. D

    May Jan Feb Mar Apr

Show answer and explanation

Correct answer: A

Question 5 Single choice

Which of the following code segments correctly readies a database query, creating a valid statement handle and a result set?

Assume $dbh represents a valid database handle.

  1. A

    $sth = $dbh->prep_statement(SELECT * FROM aTable); $sth->execute_statement;

  2. B

    $sth = $dbh->prepare(SELECT * FROM aTable); $sth->execute;

  3. C

    $sth = $dbh->prep_statement(SELECT * FROM aTable); $sth->execute;

  4. D

    $sth = $dbh->prepare_statement(SELECT * FROM aTable); $sth->execute_statement;

Show answer and explanation

Correct answer: B

Question 6 Single choice

Consider the following program code:

$Animal = Dogs bark;

package Cat;

$Animal = Cats purr;

{

package Fish;

$Animal = Fish swim;

} p

ackage main;

print $Animal;

What is the result of executing this program code?

  1. A

    The code will fail at line 4.

  2. B

    The code will output the following: Dogs bark

  3. C

    The code will output the following: Cats purr

  4. D

    The code will output the following: Fish swim

Show answer and explanation

Correct answer: B

Question 7 Single choice

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?

  1. A

    one

  2. B

    two

  3. C

    three

  4. D

    four

Show answer and explanation

Correct answer: D

Question 8 Single choice

Which one of the following choices lists only valid expression operators?

  1. A

    + - ** //

  2. B

    * ** / //

  3. C

    ** / ++ %

  4. D

    */ % -- **

Show answer and explanation

Correct answer: C

Question 9 Single choice

In Perl, packages are used for which task?

  1. A

    To label a program

  2. B

    To encrypt a program

  3. C

    To create new keywords

  4. D

    To define a namespace

Show answer and explanation

Correct answer: D

Question 10 Single choice

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?

  1. A

    The code will output the following: apple sun

  2. B

    The code will output the following: sun apple

  3. C

    The code will output the following: red yellow

  4. D

    The code will output the following:
    apple red sun yellow

Show answer and explanation

Correct answer: C