Home / Interview / Perl :: General Questions

Interview :: Perl

101)

What are some common methods to all handles in Perl?

  • err
  • errstr
  • trace
  • rows
102)

What does localtime() do in Perl?

The localtime() function is used without any argument, returns the current date and time according to the system.

103)

What is the use of now constructor in Perl?

The now constructor creates DateTime object displaying the current date and time using DateTime module.

104)

Explain gmtime() function in Perl?

This function works similar to localtime() with only one difference that returned value is localized for the standard Greenwich time zone.

105)

What is epoch time in Perl?

The epoch time refers to the number of seconds after a specific date and time. This specific date and time vary for different operating systems. For example, for Unix, it is January 1, 1970.

106) What is POSIX in Perl?

POSIX - Perl interface to IEEE Std 1003.1

The POSIX module allows you to access all the standard POSIX identifiers. This module provides much more functions than any other module.

107)

Explain strftime() function in Perl?

The Perl POSIX strftime() function is used to format date and time with the specifiers preceded with (%) sign.

108)

Explain socket programming in Perl?

The socket is a procedure which helps to establish a virtual connection between different processes over a network.

In socket programming, client and server-side script are made which communicate through each other over TCP/IP protocol.