πŸ“Š Perl
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) A place to store values in the form of a list

Explanation: In Perl, Directory is a place to store values in the form of a list.

πŸ“Š Perl
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of these

Explanation: Different operations that can be performed on a directory are:

Creating a new directory
Opening an existing directory
Reading contents of a directory
Changing a directory path
Closing a directory
Removing the directory

πŸ“Š Perl
Q. The chdir() function used to ___
  • (A) Change directory
  • (B) Remove directory
  • (C) Create directory
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) Change directory

Explanation: The chdir() function used to change the current directory in Perl.

πŸ“Š Perl
Q. Which method in Perl is used to delete a directory?
  • (A) deldir
  • (B) rmdir
  • (C) cldir
  • (D) chdir
πŸ’¬ Discuss
βœ… Correct Answer: (B) rmdir

Explanation: In Perl, rmdir is used to delete a directory.

πŸ“Š Perl
Q. Which method in Perl is used to delete a directory?
  • (A) deldir
  • (B) rmdir
  • (C) cldir
  • (D) chdir
πŸ’¬ Discuss
βœ… Correct Answer: (B) rmdir

Explanation: In Perl, rmdir is used to delete a directory.

πŸ“Š Perl
Q. A group of statements that perform a specific task is known as ___.
  • (A) Function
  • (B) Subroutine
  • (C) Method
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of these

Explanation: A group of statements that perform a specific task is known as function or subroutine or method.

πŸ“Š Perl
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) sub function_name{ }

Explanation: The valid method to define a function in Perl,

sub function_name{
}

πŸ“Š Perl
Q. Arguments in Perl are passed as ___.
  • (A) Values
  • (B) Strings
  • (C) Array
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) Array

Explanation: Arguments in Perl are passed as values, strings, array.

πŸ“Š Perl
Q. Is return type required for a subroutine in Perl?
  • (A) yes
  • (B) no
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) no

Explanation: No, the return type is required for a subroutine in Perl.

πŸ“Š Perl
Q. Is it possible to pass file handles to subroutines in Perl?
  • (A) Yes
  • (B) No
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (A) Yes

Explanation: It is possible to pass file handles to subroutines in Perl.