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:
do(FILENAME)
$! = ENOENT; undef;
(The autodie module can't help you since it doesn't support the do function.)
do
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).
do_or_die
Bo Lindbergh <blgl@stacken.kth.se>
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.
To install Acme::DoOrDie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::DoOrDie
CPAN shell
perl -MCPAN -e shell install Acme::DoOrDie
For more information on module installation, please visit the detailed CPAN module installation guide.