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


Please Help Members By Posting Answers For Below Questions

When would `local $_' in a function ruin your day?

548


What does cgi program store?

548


When do you use perl programming?

596


What is the difference between perl list and perl array?

475


What is the use of -n and -p options?

612






how to get back up from private character editor which is saved in the format of .udf

1862


How does a “grep” function perform?

605


What is grep used for in perl?

539


Explain string comparison operators in perl.

567


Explain '->' in perl?

513


How do find the length of an array?

532


Explain which feature of PERL provides code reusability?

743


What are the different instances used in cgi overhead?

590


What does next statement do in perl?

587


Explain what is perl language?

521