7 use base qw(Root Common);
12 my ( $self, $path ) = @_;
13 if ( defined $path ) {
14 $self->{path} = $path;
16 if ( defined $self->{path} ) {
19 croak "Pairwise::run: path to pairwise not defined";
25 my ( $self, $fasta ) = @_;
30 my $f1 = File::Temp->new->filename;
31 my $f2 = File::Temp->new->filename;
32 $fasta->write_file($f1);
33 my $pairwise = $self->path;
34 system("$pairwise $f1 > $f2");
35 check( $pairwise, $? ) or croak "Pairwise::run: $pairwise was naughty\n";
36 open( my $fh, "<", $f2 );
37 my @output = join "\n", split "\n", <$fh>;
46 my ( $self, $fasta ) = @_;
48 local ( $/, $? ) = ( undef, 0 );
50 my $f = File::Temp->new->filename;
51 $fasta->write_file($f);
53 my $pid = open my $fh, $self->path . " $f |" or die $!;
55 my @output = join "\n", split "\n", <$fh>;
58 check( $self->path, $? ) or die "Pairwise was naughty\n";