Perl MCQs with answers Page - 7

Here, you will find a collection of MCQ questions on Perl. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. The getdir command

  • (A) Reads a single file name from an open directory handle
  • (B) Reads the rest of the file names from an open directory handle
  • (C) Only works after anopendir command
  • (D) Is not a perl command

A

Admin • 833.24K Points
Coach

Q. What is a directory in Perl?

  • (A) A place to store values in the form of a list
  • (B) An array to string
  • (C) A data structure
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which of the following operations can be performed on directories?

  • (A) Creating directory
  • (B) Closing directory
  • (C) Changing directory path
  • (D) All of these

A

Admin • 833.24K Points
Coach

Q. The chdir() function used to ___

  • (A) Change directory
  • (B) Remove directory
  • (C) Create directory
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which method in Perl is used to delete a directory?

  • (A) deldir
  • (B) rmdir
  • (C) cldir
  • (D) chdir

A

Admin • 833.24K Points
Coach

Q. A group of statements that perform a specific task is known as ___.

  • (A) Function
  • (B) Subroutine
  • (C) Method
  • (D) All of these

A

Admin • 833.24K Points
Coach

Q. Which of these is a valid way to define a function in Perl?

  • (A) returntype function_name{ }
  • (B) sub function_name{ }
  • (C) function function_name{ }
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Arguments in Perl are passed as ___.

  • (A) Values
  • (B) Strings
  • (C) Array
  • (D) All of these

A

Admin • 833.24K Points
Coach

Q. Is return type required for a subroutine in Perl?

  • (A) yes
  • (B) no
  • (C) ---
  • (D) ---

A

Admin • 833.24K Points
Coach

Q. Is it possible to pass file handles to subroutines in Perl?

  • (A) Yes
  • (B) No
  • (C) ---
  • (D) ---

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ