How would you trap error occurred in the perl program/file?
Answer Posted / perly_whirly
Put your code inside of an eval. If an error occurs, the $@ variable will contain
the error. You can also raise an error by using die inside of an eval.
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Explain gmtime() function in perl?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
What is the purpose of _package_ literal?
What does the qx{ } operator do?
What syntax is used for grep() function?
How many data types are there in perl?
What are the functions that can be performed using cgi program?
How to read file into hash array ?
How will you open a file in a write-only mode in perl?
What are the steps involved when the cgi program starts running?
Differentiate between arrays and list in perl.
Difference between the variables in which chomp function work ?
What does the q{ } operator do?
Write syntax to add two arrays together in perl?
Demonstrate subroutines in perl with a simple example.