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

Explain perl. What are the advantages of programming in perl?

557


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

471


How to implement a stack in Perl?

569


what are the three groups involved in information sharing?

467


What are the options that can be used to avoid logic errors in perl?

514






What does init 5 and init 0 do?

516


What does cgi program store?

531


What's the difference between /^Foo/s and /^Foo/?

544


Why to use perl scripting?

517


Explain lists in perl?

548


What is automatic error handling in perl?

492


Explain lists and ivalue?

549


Which of these is a difference between Perl and C++ ?

560


How many types of variable in perl?

545


Explain chomp, chop, cpan, tk.

528