Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-Cmd CPAN distribution.

Report information
The Basics
Id: 57808
Status: resolved
Priority: 0/
Queue: App-Cmd

People
Owner: Nobody in particular
Requestors: polettix [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.307
Fixed in: (no value)



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.
Hi, I left a stray debugging message in the patch, c0d967bcb9912389b193 removes it. Cheers, Flavio. Il Lun 24 Maggio 2010 20:08:00, POLETTIX ha scritto: Show quoted text
> 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.
This should've been switched by 0.310, which switched to using Class::Load::load_optional_class -- rjbs