X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fcompute;h=6bdb105b29402859b23fffce2fb88eca15bfe986;hb=ef58435aaed269612750b6c40c3a7b05efcc5df0;hp=8a586592da740437341e8dc75a23d637b0a47ba1;hpb=ef6d0a089fb692b704c6ff0472c9c412cf7fdead;p=biopieces.git 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 {