Latest CIW 1D0-437 Dumps and Practice Tests

CIW Perl Fundamentals: 1D0-437 Exam

  • 1D0-437 Questions & Answers
  • Exam Code: 1D0-437
  • Exam Name: CIW Perl Fundamentals
  • Q & A: 162 Q&As

1: 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;
A.a strOne line of test
B.a stOne line of tes
C.a strOne line of tes
D.a stOne line of test
Correct Answers: B

2: Consider the following lines of code:
@array1 = (“apples”, “oranges”, “pears”, “plums”);
foreach (@array1) {print “$_\n”};
What is the result of these lines of code?
A.applesorangespearsplums
B.apples oranges pears plums
C.apples
D.apples
oranges
pears
plums
Correct Answers: D

3: 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?
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
Correct Answers: C

4: Which statement will print the capital attribute of the $kansas object?
A.print (“capital”=>$kansas);
B.print {$kansas}=>(capital);
C.print (capital)<={$kansas};
D.print $kansas->{“capital”};
Correct Answers: D

5: 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?
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
Correct Answers: A

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?
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
Correct Answers: B

7: Assuming $a = 2, which of the following evaluates as false?
A.”False”
B.$a
C.$a < 0
D.1
Correct Answers: C

8: Consider the following program code:
$y = 1;
$x = 2;
$z = 3;
do
{
print ($y );
} while ($y eq 2);
do
{
print ($x );
} until ($x eq 2);
print ($z );
What is the result of executing this program code?
A.The code will output the following:
1 2 3
B.The code will output the following:
3
C.The code will output the following:
2 3
D.The code will output the following:
3 2 1
Correct Answers: A

9: Running your Perl scripts with a d switch will perform which task?
A.Invoke the Perl debugger
B.Send standard error to a file
C.Disable breakpoints
D.Display a stack trace
Correct Answers: A

10: Which line of code represents the correct syntax to establish a reference to a database handle?
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”);
Correct Answers: D

11: Consider the following program code:
$val = 5;
if ($val++ == 6)
{
print(“True “);
}
else
{
print(“False “);
}
if ($val++ == 6)
{
print(“True “);
}
else
{
print(“False “);
}
What is the output of this code?
A.False False
B.False True
C.True False
D.True True
Correct Answers: B

12: 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?
A.%employees = (“Adrienne”, “Marketing”);
B.%employees = (“Lucy”, “Accounting”);
C.%employees = (“Lucy”, “Accounting”, “Armando”, “Finance”);
D.%employees = (“Armando”, “Finance”, “Adrienne”, “Marketing”);
Correct Answers: D

13: 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);
A.t text
20
B.t tex
19
C.t text
19
D.t tex
20
Correct Answers: D

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

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
Correct Answers: B

15: Consider the following code:
%chars = (“a”, “100”, “b”, “90”, “c”, “80”);
Which one of the following choices will reverse the key/value pairing of the code?
A.reverse(%chars);
B.%chars = reverse(%chars);
C.reverse(%chars) = %chars;
D.invert(%chars);
Correct Answers: B

16: Consider the following program code:
$x = 0;
$y = 5;
do
{
print ($x $y );
}
while (++$x < 5 && ++$y < 10);
print ($x $y );
What is the result of executing this program code?
A.The code will output the following:
1 6 2 7 3 8 4 8 5 10 6 11
B.The code will output the following:
0 5 1 6 2 7 3 8 4 9 4 9
C.The code will output the following:
0 5 1 6 2 7 3 8 4 9 5 10
D.The code will output the following:
0 5 1 6 2 7 3 8 4 9 5 9
Correct Answers: D

17: Which one of the following choices uses the correct syntax for a valid array assignment?
A.@cities = Akron, Memphis, Ogden, Phoenix;
B.@cities =~ (“Akron, Memphis”);
C.@cities =~ (Akron, Memphis, Ogden, Phoenix);
D.@cities = (“Akron”);
Correct Answers: D

18: Consider the following program code:
$x = 150;
$y = “250”;
if (($x + 100) == $y) { print(“1 “); }
if (“250” == $y)      { print(“2 “); }
if (“250” eq $y)      { print(“3 “); }
if ($x lt $y)         { print(“4 “); }
if ($x ge $y)         { print(“5 “); }
What is the result of executing this program code?
A.The code will output the following:
1 2 3 4
B.The code will output the following:
1 3 4
C.The code will output the following:
1 3 5
D.The code will output the following:
1 2 3 4 5
Correct Answers: A

19: 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?
A.Jan Feb May Apr Mar
B.Jan Feb Mar Apr May
C.Mar Apr May Jan Feb
D.May Jan Feb Mar Apr
Correct Answers: A

20: Consider the following program code:
@stack = (10, 10..25);
push(@stack, yellow);
shift(@stack);
push(@stack, white);
print shift(@stack);
What is the result of executing this program code?
A.The code will fail at line 3 because shift requires two arguments.
B.The code will output the following:
11
C.The code will output the following:
10
D.The code will output the following:
white
Correct Answers: C

http://www.lead2pass.com/1d0-437.html