New Year Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

1D0-437 CIW PERL FUNDAMENTALS Questions and Answers

Questions 4

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?

Options:

A.

Jan Feb May Apr Mar

B.

Jan Feb Mar Apr May

C.

Mar Apr May Jan Feb

D.

May Jan Feb Mar Apr

Buy Now
Questions 5

The filehandle INPUT is associated with the file represented by $file. Which statement will close the filehandle INPUT?

Options:

A.

close (INPUT, $file);

B.

closeINPUT;

C.

INPUT(close, $file);

D.

close(INPUT);

Buy Now
Questions 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?

Options:

A.

The code will output the following:

11 12 13 14 15 16 17 18 19

B.

The code will output the following:

10 11 12 13 14 16 18 20 22

C.

The code will output the following:

10 11 12 13 14 16 18 20

D.

The code will output the following:

10 11 12 13 14 15 16 17 18 19 20

Buy Now
Questions 7

Consider the following program code:

%hash = (small => 8oz,

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?

Options:

A.

The code will fail at line 1 because a hash cannot contain both numeric and string data.

B.

The code will execute without error but will output nothing.

C.

The code will output the following:

32oz

16oz

8oz

D.

The code will output the following:

large

medium

small

Buy Now
Questions 8

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

Buy Now
Questions 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:

20 100 Apple Grapefruit Orange

B.

The code will output the following:

Apple Grapefruit Orange 20 100

C.

The code will output the following:

100 20 Apple Grapefruit Orange

D.

The code will output the following:

Orange Grapefruit Apple 100 20

Buy Now
Questions 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"};

Buy Now
Questions 11

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

Buy Now
Questions 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

Buy Now
Questions 13

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:

20 100 Apple Grapefruit Orange

B.

The code will output the following:

Apple Grapefruit Orange 20 100

C.

The code will output the following:

100 20 Apple Grapefruit Orange

D.

The code will output the following:

Orange Grapefruit Apple 100 20

Buy Now
Questions 14

Consider the following lines of code:

@array1 = ("apples", "oranges", "pears", "plums");

foreach (@array1) {print "$_\n"};

What is the result of these lines of code?

Options:

A.

applesorangespearsplums

B.

apples oranges pears plums

C.

apples

D.

apples

oranges

pears

plums

Buy Now
Questions 15

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

Buy Now
Questions 16

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

Buy Now
Questions 17

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

Options:

A.

$dbh = DBI::connect("dbi:mysql:myPhoneBook");

B.

$dbh = DBD:->connect("dbi::mysql::myPhoneBook");

C.

$dbh = DBD::connect("mysql:dbi:myPhoneBook");

D.

$dbh = DBI->connect("dbi:mysql:myPhoneBook");

Buy Now
Questions 18

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

Buy Now
Questions 19

Which of the following tasks is the least effective in reducing errors in Perl scripts?

Options:

A.

Writing pseudo-code before beginning the script

B.

Writing modular code

C.

Declaring and initializing variables

D.

Using the no strict <'refs' | 'vars' | 'subs'>; commands in the code

Buy Now
Questions 20

In Perl, modules are used for which task?

Options:

A.

To organize packages

B.

To provide code reusability

C.

To separate code in a file

D.

To create separate namespaces

Buy Now
Questions 21

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.

Options:

A.

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

$sth->execute_statement;

B.

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

$sth->execute;

C.

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

$sth->execute;

D.

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

$sth->execute_statement;

Buy Now
Questions 22

Which of the following correctly creates a SQL statement that will insert the values of the $name and $age variables into a database? The statement is assigned to the $sqlStmt variable. Assume a CHAR data type for $name and an INT data type for $age.

Options:

A.

$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

B.

$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name\, $age)};

C.

$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

D.

$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES (\$name\, $age)};

Buy Now
Exam Code: 1D0-437
Exam Name: CIW PERL FUNDAMENTALS
Last Update: Dec 26, 2024
Questions: 169
1D0-437 pdf

1D0-437 PDF

$25.5  $84.99
1D0-437 Engine

1D0-437 Testing Engine

$30  $99.99
1D0-437 PDF + Engine

1D0-437 PDF + Testing Engine

$40.5  $134.99