X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fcompute;h=0bcd6ca9fe6bea499411b1dc207bfcbc4a2bd64e;hb=5aa6482643719c640f828c37a4ab23cde28be591;hp=1c5c25862526d8e24c301085fb3226e567155da8;hpb=3112613123dda7a0264264be464111bb3f18c79f;p=biopieces.git diff --git a/bp_bin/compute b/bp_bin/compute index 1c5c258..0bcd6ca 100755 --- a/bp_bin/compute +++ b/bp_bin/compute @@ -64,17 +64,16 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) map { $eval_val =~ s/\Q$_\E/$record->{ $_ }/g } @keys; - - if ( $eval_val !~ /\s+[+\-\*]{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 {