Stéphane Wenric wrote, On 10/15/2012 03:04 AM:
On Fri, Oct 12, 2012 at 10:51 PM, Assaf Gordon <gordon@cshl.edu <mailto:gordon@cshl.edu>> wrote:
However, in development mode with "warnings: 1", the "do_something" die()s and the dancer application stops with the standard HTTP 500 page with the stack trace.
I don't want to turn "warnings" off, but I want to be able to mask this specific warning.
I guess you could always disable warnings locally, before your function call, and re-enable them after. Something like
eval { no warnings; do_something_that_might_fail(); use warnings; $ok = 1; };
Unfortunately this doesn't work. Perhaps calling it "warning" is the wrong term, because the code in "do_something()" uses "die" (not "warn"), but adding "no warnings" has no effect - I still get the standard Dancer 500 error page with the stack-trace.