Home / Interview / Perl :: General Questions

Interview :: Perl

91) Explain the difference between die and exit in Perl?

The die function prints the standard error message then exits the program. Whereas, the exit function terminates the program without giving any error message.

92)

What $! in Perl?

The $! is a built-in error reporting variable in Perl. It tells us the reason for the error and prints it. It prints what the operating system tells it.

93)

What is warn function in Perl?

The warn function gives the warning on encountering an error but does not exit the script. The Script keeps on running.

94)

What is confess function in Perl?

The confess function is used within the Carp standard library for error handling.

95)

What is eval function in Perl?

The eval function is a built-in function in Perl which is used to detect the normal fatal error. It is supplied with a code block instead of passing into a string.

96)

What is Perl DBI?

DBI stands for Database Independent Interface. In Perl, the database is accessed using DBI module. It is a third party module provided by CPAN. It supports all the major database systems. It provides an abstraction layer between Perl code and database.

97)

What does 'do' statement do in Perl?

The "do statement" is used in Perl database. It is a shortcut to perform all the CRUD operation. If it is succeeded, it returns true, otherwise false.

98)

What is 'commit' command in Perl?

Once you have given Perl commit command, you can't retrieve back the changes you made.

Syntax:

99)

What is 'rollback' command in Perl?

If you want to revert the changes made during the operation, call rollback command.

100)

What is automatic error handling in Perl?

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.