fix return value mod in distance_trees
Tara L Andrews [Wed, 1 Feb 2012 00:03:09 +0000 (01:03 +0100)]
lib/Text/Tradition/Stemma.pm
lib/Text/Tradition/StemmaUtil.pm

index 9244580..35c0f1e 100644 (file)
@@ -191,15 +191,11 @@ before 'distance_trees' => sub {
        || $args{'program'} ne $self->distance_program ) {
         # We need to make a tree before we can return it.
         my $dsub = 'run_' . $args{'program'};
-        my( $ok, $result ) = $self->$dsub();
-        if( $ok ) {
-            # Save the resulting trees
-            my $trees = parse_newick( $result );
-            $self->_save_distance_trees( $trees );
-            $self->distance_program( $args{'program'} );
-        } else {
-            throw( "Failed to calculate distance trees: $result" );
-        }
+        my $result = $self->$dsub(); # this might throw an error - catch it?
+               # Save the resulting trees
+               my $trees = parse_newick( $result );
+               $self->_save_distance_trees( $trees );
+               $self->distance_program( $args{'program'} );
     }
 };
 
index 0158d61..15e7f89 100644 (file)
@@ -146,6 +146,7 @@ sub phylip_pars {
     }
     return join( '', @outtree ) if @outtree;
 
+       # If we got this far, we are about to throw an error.
     my @error;
     if( -f "$phylip_dir/outfile" ) {
         open( OUTPUT, "$phylip_dir/outfile" ) or die "Could not open output for read";