Subject: | Silent failure upon errors in MyApp::Command |
When a base class for all commands (e.g. "MyApp::Command") contains errors that prevent a
clean compilation, these errors are silently discarded by App::Cmd::Setup due to the "eval
STRING" approach in requiring it. For example, this should complain a lot about the
undefined variable:
package MyApp::Command;
use strict;
use warnings;
use App::Cmd::Setup -command;
sub execute {
$not_declared = 1;
return 'OK';
}
1;
__END__
but it doesn't, and the error that is emitted does not give a clue about what's going on, being
some kind of action-at-distance.
You can find a test case in http://github.com/polettix/app-cmd/commits/manual , commits
760fa7c24c1bc61b85af and 6b7af02ad1f1fd3c509d (this should allow a more focused test
case). The proposed patch can be found in commit cee845fa1625148da9ef. All these three
commits apply against the "manual" branch, which I saw was the most up-to-date.
Cheers,
Flavio.