Acme::DoOrDie - do-file replacement that dies on errors
use Acme::DoOrDie; do_or_die("config.pl");
Error handling for the
do(FILENAME) built-in function is inconvenient. The main problem is that you need to examine more than just the return value to distinguish a file-not-found condition from a successful invocation of a file that ends with these two statements:
$! = ENOENT; undef;
(The autodie module can't help you since it doesn't support the
This module provides the replacement function
do_or_die that reports any error by throwing an exception. The same function is also available under the alias
do (not exported by default).
Bo Lindbergh <email@example.com>
Copyright 2017 Bo Lindbergh
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.