-
Now, I want to create a custom "die" handler. So I have:
Code:
print "Content-Type: text/html\n\n";
$SIG{__DIE__} = sub {print "Custom error: $_[0]";};
require 'test2.pl';
In test2.pl, I have:Now, when I run the first script, instead of seeing "Custom error: test at blablablabla..........", I see the following:
custom error: test at test2.pl line 1. custom error: test at test2.pl line 1. Compilation failed in require at C:\Inetpub\Scripts\test.pl line 3.
Why is the custom error generated twice? And why did the compilation failed? Is it because the script "died" before parsing the "1;"?
-
Hi,
have you tried to put an exit inside your die function?
Musicman
-
Yes I have, and now it works.
But what is causing the strange output?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|