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
What is the purpose of _package_ literal?
What are the arguments and what do they mean in perl programming?
What does file test operators do in perl?
Explain splicing of arrays?
What is -> symbol in perl?
How to convert strings into an array in perl?
Write a program to show the process of spawning a child process
What is “grep” function in perl?
Differentiate use and require?
If you want to empty an array then how would you do that?
What are the advantages of c over Perl?
What is grep used for in perl?
How do I generate a list of all .html files in a directory?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
What can be done for efficient parameter passing in perl?