CIW PERL FUNDAMENTALS v5.0

Page:    1 / 10   
Exam contains 149 questions

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

  • A. ++
  • B. **
  • C. /
  • D. <?>?


Answer : A

Consider the following code:
$_ = "New York";
@array2 = split(//);
What is the value of $array2[0] after the code is executed?

  • A. ""
  • B. "N e w"
  • C. "NewYork"
  • D. "N"


Answer : D

Consider the following lines of code:
sub mySub {
($arg, @args) = @_;
foreach $val (@args) {
$returnVal .= "$arg, $val\n";
}
$returnVal . "" . @args;
}
print &mySub(1, "a value", "another value", "a parameter", "another parameter");
What is the output of these lines of code?

  • A. 1, a value 1, another value 1, a parameter 1, another parameter 4
  • B. 1, a value 1, another value 1, a parameter 1, another parameter a valueanother valuea parameteranother parameter
  • C. 1, a value, another value, a parameter, another parameter a value another value a parameter another parameter
  • D. 1, a value, another value, a parameter, another parameter 4


Answer : A

Which statement writes data to the filehandle OUTPUT?

  • A. print "Here's my data.\n" > OUTPUT
  • B. write OUTPUT "Here's my data.\n";
  • C. write OUTPUT ">Here's my data.\n";
  • D. print OUTPUT "Here's my data.\n";


Answer : D

Which statement is the most accurate?

  • A. The unshift function removes elements from the beginning of an array.
  • B. The unshift function adds elements to the end of an array.
  • C. The shift function adds elements to the end of an array.
  • D. The shift function removes elements from the beginning of an array.


Answer : D

Which one of the following choices will assign the current package Library1?

  • A. package::Library1;
  • B. Library1::package;
  • C. package(Library1);
  • D. package Library1;


Answer : D

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

  • A. \@array4;
  • B. @array4($ref);
  • C. getpass(\@array4);
  • D. getpass{@array4};


Answer : C

Which of the following is a valid subroutine name?

  • A. _funct7
  • B. get-pass
  • C. #sub1
  • D. @passwd


Answer : A

Consider the following assignments:
$x = 9
$y = 7
$z = 5
Given these assignments, which one of the following expressions evaluates as true?

  • A. ($x - $y) != ($y - $z);
  • B. ($z * 2) <= $x;
  • C. ($y + $z + $x) = $y*3;
  • D. ($x 2) > $y;


Answer : C

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?

  • 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:
  • D. The code will fail at line 5 because $result is not enclosed by parentheses.


Answer : C

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

  • A. b and d
  • B. t and c
  • C. s and n
  • D. X and V


Answer : C

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?

  • A. The code will output the following: 100-25
  • B. The code will output the following:
  • C. The code will fail at line 3 because $y contains string data.
  • D. The code will output the following: 125


Answer : B

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

  • A. The code will output the following:
  • B. The code will output the following:
  • C. The code will output the following:
  • D. The code will output the following: multiply(5, 10)


Answer : B

Consider the following program code:
package Dog;
$string = Walk the dog.;
if($string eq Walk the dog.)
{
package Cat;
$string = Pet the cat.;
print($string\n);
}
print ($string\n);
What is the result of executing this program code?

  • A. The code will output the following: Pet the cat.
  • B. The code will output the following: Walk the dog.
  • C. The code will output the following: Pet the cat. Walk the dog.
  • D. The code will output the following: Walk the dog. Pet the cat.


Answer : C

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

  • A. open(PASSWD, ">/etc/passwd");
  • B. open(PASSWD ">/etc/passwd");
  • C. open(PASSWD, ">>/etc/passwd");
  • D. open(PASSWD "+>/etc/passwd");


Answer : C

Page:    1 / 10   
Exam contains 149 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy