[Bps-public-commit] r18593 - App-CLI/lib/App

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Feb 25 16:04:42 EST 2009


Author: alexmv
Date: Wed Feb 25 16:04:39 2009
New Revision: 18593

Modified:
   App-CLI/lib/App/CLI.pm

Log:
Allow commands to be provided by inner packages

Modified: App-CLI/lib/App/CLI.pm
==============================================================================
--- App-CLI/lib/App/CLI.pm	(original)
+++ App-CLI/lib/App/CLI.pm	Wed Feb 25 16:04:39 2009
@@ -101,8 +101,9 @@
     my $pkg = join('::', $class->command_class, $class->_cmd_map ($cmd));
     my $file = "$pkg.pm";
     $file =~ s!::!/!g;
+    eval {require $file; };
 
-    unless (eval {require $file; 1} and $pkg->can('run')) {
+    unless ($pkg->can('run')) {
 	warn $@ if $@ and exists $INC{$file};
 	die $class->error_cmd;
     }



More information about the Bps-public-commit mailing list