in reply to Re: Parsing Text from Object Header that prints to STDOUT
in thread Parsing Text from Object Header that prints to STDOUT

It seems that it does *explicitly* print to STDOUT. I tried your snippet under my code plus
print "SCORE I WANT = $score\n";
It still print those all output plus: SCORE I WANT = <blank>
Regards,
Edward


PS. How did you change your name? I thought it is never possible ;-)

Replies are listed 'Best First'.
Re^3: Parsing Text from Object Header that prints to STDOUT
by tlm (Prior) on Apr 20, 2005 at 18:27 UTC

    I like davidrw's idea, though I have never used it myself. This also works, if you have v5.8.x:

    my ( $aln2, $buf ); { local *STDOUT; open( STDOUT, '>', \$buf ) or die "Write to buffer failed\n"; $aln2 = $factory->align($seq_array_ref); } # find desired line in $buf my ($score) = $buf =~ /SCORE (\d+)/;

    the lowliest monk