From 9a92dc906b4bc897c4bdbde5e9a020384b35319f Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 3 Jan 2012 14:17:38 +0000 Subject: [PATCH] fixed issue in compute git-svn-id: http://biopieces.googlecode.com/svn/trunk@1718 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/compute | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bp_bin/compute b/bp_bin/compute index 93206f0..52ef66d 100755 --- a/bp_bin/compute +++ b/bp_bin/compute @@ -28,6 +28,7 @@ use warnings; use strict; +use Data::Dumper; use Maasha::Common; use Maasha::Biopieces; @@ -63,9 +64,17 @@ 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 !~ /\s/) + { + $record->{ $eval_key } = $eval_val; + } + else + { + $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