in reply to die function
how can i print script name and line number in the die function
As others have said, if you don't have a newline on the end of the message that you pass to die then you'll get a message of the form "{your message} at {filename} line {line number}". If you want to rearrange that format, you can do that using __FILE__ and __LINE__.
die 'File: ', __FILE__, ' Line: ', __LINE__, " Oops!\n";
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|