From: martinahansen Date: Wed, 18 Apr 2012 07:44:22 +0000 (+0000) Subject: fixed issue 32 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=88c9e0b80c7466de978791b4c4519a03e2786048;p=biopieces.git fixed issue 32 git-svn-id: http://biopieces.googlecode.com/svn/trunk@1797 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/compute b/bp_bin/compute index 8a58659..6bdb105 100755 --- a/bp_bin/compute +++ b/bp_bin/compute @@ -64,16 +64,16 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) map { $eval_val =~ s/\Q$_\E/$record->{ $_ }/g } @keys; - if ( $eval_val !~ /\s+[+\-\*x]{1,2}\s+/) - { - $record->{ $eval_key } = $eval_val; - } - else + if ( $eval_val =~ /\+|\-|\*|\\/ or $eval_val =~ /\s+x\s+/) { $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 + { + $record->{ $eval_key } = $eval_val; + } } else {