]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/compute
removed debug message
[biopieces.git] / bp_bin / compute
index 93206f06d5f5380bdbd30f1b8805fce989040c9c..0bcd6ca9fe6bea499411b1dc207bfcbc4a2bd64e 100755 (executable)
@@ -28,6 +28,7 @@
 
 use warnings;
 use strict;
+use Data::Dumper;
 use Maasha::Common;
 use Maasha::Biopieces;
 
@@ -63,9 +64,16 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
         map { $eval_val =~ s/\Q$_\E/$record->{ $_ }/g } @keys;
 
-        $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' };
+        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
     {