Q. What are 'listary operators' in Perl?

  • (A) Operator on collections
  • (B) Operators on integers
  • (C) Operators on the list of operators
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) Operators on the list of operators

Q. What is the correct operator precedence for the following operators?

Code:
 && , &, = , ->
  • (A) & , && , = , ->
  • (B) -> , & , && , =
  • (C) = , & , && , ->
  • (D) = , -> , && , &
πŸ’¬ Discuss
βœ… Correct Answer: (B) -> , & , && , =

Q. Do we need to specify the data type of a variable in Perl?

  • (A) Yes
  • (B) No
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) No
Explanation: In Perl, the data type declaration of variables is not required.

Q. Which of these is a valid way to start a variable?

  • (A) $
  • (B) @
  • (C) %
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of these
Explanation: You can start a variable using $, @, % character.

Q. Which of these is not a basic data type in Perl?

  • (A) Integer
  • (B) Arrays
  • (C) Scalars
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Integer
Explanation: Perl in basic data types are:

Scalar variable
Array variable
Hash variable

Q. Scalar variables in Perl are ___.

  • (A) Array values
  • (B) A Single unit of data
  • (C) String Values
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) A Single unit of data
Explanation: Scalar variables in Perl are a single unit of data. Different types of scalars in Perl are string, character, floating point, large group of string, webpage, etc.

Q. Global scope variables can be used

  • (A) Inside any function or block
  • (B) Inside a specific function
  • (C) Inside a specific block
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Inside any function or block
Explanation: Global scoped variable is declared outside all blocks of code. The scope of this variable inside any function or block.

Q. 'Our' keyword is used to ___.

  • (A) Create an alias to package
  • (B) Create a new variable
  • (C) Create a virtual variable
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Create an alias to package
Explanation: The "Our" keyword is used to create an alias to package.

Q. What is a module in Perl?

  • (A) Collection of related subroutines and variables
  • (B) Array of functions
  • (C) Collection of values of same type
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Collection of related subroutines and variables
Explanation: A module in Perl is a collection consisting of variables and related subroutines.

Q. Which statement in Perl is used to import a module?

  • (A) import module_name
  • (B) include module_name
  • (C) use module_name
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) use module_name
Explanation: The "use" keyword in Perl is used to import a module in Perl.