Index: /trunk/ippScripts/scripts/phase0_exp.pl
===================================================================
--- /trunk/ippScripts/scripts/phase0_exp.pl	(revision 9267)
+++ /trunk/ippScripts/scripts/phase0_exp.pl	(revision 9268)
@@ -119,9 +119,10 @@
 # Output results to the database
 unless ($no_update) {
-    my $command = "$p0tool -updateexp -exp_tag $exptag"; # Command to execute to update exposure parameters
+    my @command;
+    push @command, $p0tool, '-updateexp', '-exp_tag', $exptag; # Command to execute to update exposure parameters
     
     # Add the values of interest
     foreach my $constant (@{CONSTANTS()}) {
-        $command .= " -" . $constant . " " . $values{$constant};
+	push @command, ( '-' . $constant ), $values{$constant};
     }
     foreach my $variable (@{VARIABLES()}) {
@@ -129,5 +130,5 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@$array);
-        $command .= " -" . $variable . " " . $stats->mean();
+	push @command, ( '-' . $variable ), $stats->mean();
     }
 
@@ -136,9 +137,9 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@backgrounds);
-        $command .= " -" . PHASE0_BG() . " " . $stats->mean();
+	push @command, ( '-' . PHASE0_BG() ), $stats->mean(), ( '-' . PHASE0_BG_STDEV() );
         if (scalar @backgrounds == 1) {
-            $command .= ' -' . PHASE0_BG_STDEV() . " 0.0";
+	    push @command, 1;
         } else {
-            $command .= " -" . PHASE0_BG_STDEV() . " " . $stats->standard_deviation();
+	    push @command, $stats->standard_deviation();
         }
     }
@@ -146,5 +147,5 @@
         my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
         $stats->add_data(@stdevs);
-        $command .= " -" . PHASE0_BG_MEAN_STDEV() . " " . $stats->mean();
+	push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), $stats->mean();
     }
     
@@ -152,5 +153,5 @@
     foreach my $detrendType (@{DETRENDS()}) {
         if (lc($values{TYPE()}) eq lc($detrendType)) {
-            $command .= " " . DETREND_FLAG;
+	    push @command, DETREND_FLAG;
             last;
         }
@@ -158,5 +159,5 @@
  
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => 1);
+        run(command => \@command, verbose => 1);
     die "Unable to run phase0 update for $exptag: $error_code\n" if not $success;
 }
