Perl Interview Questions and Answers
Question - 81 : - Explain socket programming in Perl?
Answer - 81 : -
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.
Question - 82 : - Explain strftime() function in Perl?
Answer - 82 : -
The Perl POSIX strftime() function is used to format date and time with the specifiers preceded with (%) sign.
Question - 83 : - What is POSIX in Perl?
Answer - 83 : -
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.
Question - 84 : - What is epoch time in Perl?
Answer - 84 : -
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.
Question - 85 : - Explain gmtime() function in Perl?
Answer - 85 : -
This function works similar to localtime() with only one difference that returned value is localized for the standard Greenwich time zone.
Question - 86 : - What is the use of now constructor in Perl?
Answer - 86 : -
The now constructor creates DateTime object displaying the current date and time using DateTime module.
Question - 87 : - What are some common methods to all handles in Perl?
Answer - 87 : -
Question - 88 : - What is automatic error handling in Perl?
Answer - 88 : -
By specifying RaiseError option, your errors will be handled automatically by Perl. Your program will be aborted on encountering an error rather than running a failure code. Its value can be either 1 or 0.
Question - 89 : - What is 'rollback' command in Perl?
Answer - 89 : -
If you want to revert the changes made during the operation, call rollback command.
Syntax:
$dbh->rollback or die $dbh->errstr;
Question - 90 : - What is 'commit' command in Perl?
Answer - 90 : -
Once you have given Perl commit command, you can't retrieve back the changes you made.
Syntax:
$dbh->commit or die $dbh->errstr;