Home / Interview / Perl :: General Questions

Interview :: Perl

11) When does circular reference occur?

When the two references also contain references to each other, then the case of circular reference occurs.

12) What happens in dereferencing?

Value to the location from the reference point is returned.

13) What does read () command do?

The read() command is used to read the block of information from the buffered file handle.

14) What is the use of 'ne' operator?

The operator compares the value of the left string to the right one and returns true if they are not equal.

15) What does the q{ } operator do?

The operator encloses a string in the single quotes.

16) What does the qq{ } operator do?

The operator encloses a string in the double quotes.

17) What does the qx{ } operator do?

The operator encloses a string in the inverted quotes.

18)

How many data types are there in Perl?

Perl has three data types:

  • Scalars
  • Arrays
  • Hashes

19)

What are Perl variables?

A variable is a place to store values reserving some memory space. Perl treats the same variables differently based on context.

There are three types of Perl variables:

  • Scalars
  • Arrays
  • Hashes

20)

What are scalars?

A scalar contains a single unit of data. They are preceded with a ($) sign. A scalar contains a number, character, reference or a string. A reference is the address of the variable.