Introduction to Perl Programming Quiz Questions and Answers

Which of the following special variable represents the current file name?

Answer :
  • _FILE_

Which of the following methods pushes the values of the list onto the end of the array?

Answer :
  • push @ARRAY, LIST

To verify if the variable $str contains the word “test” you would use______.

Answer :
  • if ($str = ~/test/)

Scalar stores_______.

Answer :
  • single values

Which function is used by Perl for displaying the length of a string?

Answer :
  • length

Recursing down directories can be done using______.

Answer :
  • File::Find

Scalar is denoted by_______in Perl.

Answer :
  • $

Can we load binary extension dynamically?

Answer :
  • Yes

Select data type in Perl which stores associative arrays.

Answer :
  • hash

Which brackets do you use to change the order of precedence of operations?

Answer :
  • Round brackets