From: Tara L Andrews Date: Mon, 9 Jun 2014 20:54:41 +0000 (+0200) Subject: add option to pass explicit path to pars executable X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5f669a830d1d9dff02ef4498c1125630377342e;p=scpubgit%2Fstemmatology.git add option to pass explicit path to pars executable --- diff --git a/analysis/lib/Text/Tradition/StemmaUtil.pm b/analysis/lib/Text/Tradition/StemmaUtil.pm index f7410bc..d4b48d6 100644 --- a/analysis/lib/Text/Tradition/StemmaUtil.pm +++ b/analysis/lib/Text/Tradition/StemmaUtil.pm @@ -337,7 +337,7 @@ Runs Phylip Pars on the given character matrix. Returns results in Newick forma =cut sub phylip_pars { - my( $charmatrix ) = @_; + my( $charmatrix, $opts ) = @_; # Set up a temporary directory for all the default Phylip files. my $phylip_dir = File::Temp->newdir(); # $phylip_dir->unlink_on_destroy(0); @@ -368,9 +368,9 @@ sub phylip_pars { close CMD; # And then we run the program. - my $program = File::Which::which( 'pars' ); + my $program = $opts->{parspath} || File::Which::which( 'pars' ); unless( $program && -x $program ) { - throw( "Phylip pars not found in path" ); + throw( "Phylip pars $program not executable" ); } {