Can anyone please explain me about carp subroutine with sample Perl code?
Can anyone please explain me about carp subroutine with sample Perl code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See the
perldocfor Carp.carpis a alternative for Perl’swarnfunction that uses stack trace information to show you where you called a function that issued a warning. This can be more helpful thanwarn‘s behavior of telling you where the warning occurred.An example:
This program:
tells you:
But if we change
warntocarp:it tells you:
The extra line of information is helpful in tracking down places where you might be using a function or module incorrectly.