in reply to Cache::Memcached and converting warnings to fatal
would help :-)# Inside your script: package Cache::Memcached; use warnings FATAL => 'all'; package main; [...]
Just use the handler. This is also mentioned in the perldoc page of eval. Please don't forget to use the local statement to make the handler local to your closure:
I also would remove the argument to die as long you don't want the warning message, which is now the error message, printed. Normally you do a warn $@ if $@ or similar.my $stats = eval { local $SIG{'__WARN__'} = sub { die }; $memd->stats(); } if ($@) { # No stats!! [...] }
|
|---|