#!/usr/bin/perl use warnings; use strict; use Carp; my $pid = open my $pipe, '-|'; defined $pid or croak "unable to fork"; if ($pid==0) { # child process print "SCORE=134"; # my $aln2 = $factory->align($seq_array_ref); exit(0); } else { # parent process my $score; while(<$pipe>) { if (/SCORE=(\d+)/) { $score=$1; last; } } print "score=$score\n"; }