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

You want to print the contents of an entire array. How would you do that?

620


Explain tk?

584


Explain the use of 'my' keyword in perl?

647


Which guidelines by Perl modules must be followed?

665


What are the steps involved when the cgi program starts running?

582






What is the difference between use and require in perl programming?

587


What is use of ‘->’ symbol?

635


How to close a directory in perl?

559


How do you match one letter in the current locale?

646


You want to empty an array. How would you do that?

547


What is perl scripting?

589


What is perl programming?

647


Why is it hard to call this function: sub y { "because" } ?

609


What is the use of now constructor in perl?

598


What is the usage of -i and 0s options?

641