From bc83274efde0dc7ccb110f5ed7f45e0c2c991564 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 21 Sep 2009 07:56:31 +0000 Subject: [PATCH] added format to compute git-svn-id: http://biopieces.googlecode.com/svn/trunk@681 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/compute | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bp_bin/compute b/bp_bin/compute index 0b2e280..93206f0 100755 --- a/bp_bin/compute +++ b/bp_bin/compute @@ -39,7 +39,8 @@ my ( $options, $in, $out, $record, $eval_key, @keys, $eval_val ); $options = Maasha::Biopieces::parse_options( [ - { long => 'eval', short => 'e', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef }, + { long => 'eval', short => 'e', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef }, + { long => 'format', short => 'f', type => 'string', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, ] ); @@ -64,6 +65,7 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) $record->{ $eval_key } = eval "$eval_val"; Maasha::Common::error( qq(eval "$eval_key = $eval_val" failed -> $@) ) if $@; + $record->{ $eval_key } = sprintf( $options->{ 'format' }, $record->{ $eval_key } ) if $options->{ 'format' }; } else { -- 2.39.5