Author: kwilliams
Date: Mon Jan 22 21:50:29 2007
New Revision: 8681

Modified:
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
Use a more common idiom for exception handling

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Mon Jan 22 21:50:29 2007
@@ -1857,11 +1857,9 @@
 }
 
 sub get_action_docs {
-  my ($self, $action, $actions) = @_;
-  $actions ||= $self->known_actions;
-  $@ = '';
-  ($@ = "No known action '$action'\n"), return
-    unless $actions->{$action};
+  my ($self, $action) = @_;
+  my $actions = $self->known_actions;
+  die "No known action '$action'" unless $actions->{$action};
 
   my ($files_found, @docs) = (0);
   foreach my $class ($self->super_classes) {
@@ -1967,8 +1965,8 @@
   my $actions = $self->known_actions;
   
   if (@{$self->{args}{ARGV}}) {
-    my $msg = $self->get_action_docs($self->{args}{ARGV}[0], $actions) || 
"[EMAIL PROTECTED]";
-    print $msg;
+    my $msg = eval {$self->get_action_docs($self->{args}{ARGV}[0], $actions)};
+    print $@ ? "[EMAIL PROTECTED]" : $msg;
     return;
   }
 

Reply via email to