programming languages Online Quiz - 226

Description: programming languages Online Quiz - 226
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. Invoke the Perl debugger

  2. Disable the Perl debugger

  3. Disable breakpoints

  4. Display a stack trace

Correct Option: A

Which file test can be done to see if a file is a socket?

  1. -s

  2. -l

  3. -S

  4. -k

Correct Option: A

How can you include code from another file in your program?

  1. With the #include preprocessor command

  2. Adding the file’s directory to @INC and then passing the filename to require.

  3. Both A & B

  4. None of the above

Correct Option: C
  1. grep(! /^ !/, @array);

  2. Every non empty list element

  3. Every list element that does not start with an exclamation mark.

  4. Every list element.

Correct Option: B

What is the default sort order in Perl?

  1. alphabetic

  2. numeric

  3. ASCII

  4. none of the above

Correct Option: C

Rather than using print, what is often used in Perl when formatting is important?

  1. printf

  2. format

  3. align

  4. show

Correct Option: A

If $string contains abcdefghijiklmdef , what will the following call return? rindex($string , "def", 11 );

  1. 14

  2. 3

  3. 4

  4. 15

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

  2. The code will execute without error but will output nothing.

  3. The code will output the following: 32oz 16oz 8oz

  4. The code will output the following: large medium small

Correct Option: C

Which operator can be used to create private variables within a subroutine?

  1. native

  2. limited

  3. my

  4. regional

Correct Option: C

What value do variables have before they are first assigned?

  1. undef

  2. null

  3. 0

  4. nil

Correct Option: A

Which of the following commands should be used to open a filehandle named KAREN to an existing file named sw?

  1. open KAREN ">sw";

  2. open KAREN, ">sw";

  3. open "sw" KAREN;

  4. open ">sw", KAREN;

Correct Option: B
  1. close KAREN "sw";

  2. KAREN close;

  3. close KAREN;

  4. close &KAREN

Correct Option: C

Which function can be used to break up a string into more than one part based upon a separator?

  1. chop

  2. split

  3. divide

  4. parse

Correct Option: B
- Hide questions