Index: trunk/ippScripts/scripts/phase3.pl
===================================================================
--- trunk/ippScripts/scripts/phase3.pl	(revision 11297)
+++ trunk/ippScripts/scripts/phase3.pl	(revision 11298)
@@ -19,10 +19,10 @@
 use Pod::Usage qw( pod2usage );
 
-my ($exp_tag, $camera, $outpath, $dbname, $no_update);
+my ($exp_tag, $camera, $outpath, $dbname, $workdir, $no_update);
 GetOptions(
     'exp_tag|e=s'       => \$exp_tag,
     'camera|c=s'        => \$camera,
-    'outpath|o=s'       => \$outpath,
     'dbname|d=s'        => \$dbname, # Database name
+    'workdir|w=s'       => \$workdir,
     'no-update'         => \$no_update
 ) or pod2usage( 2 );
@@ -98,11 +98,13 @@
 }
 
-# XXX old verison, drop
-#my $example = ${$files}[0]->{b1_uri}; # Example filename
-#my ($vol, $dir, $file) = File::Spec->splitpath( $example );
+unless (defined $workdir) {
+    my $example = ${$files}[0]->{b1_uri}; # Example filename
+    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
+    $workdir = $dir;
+}
 
 # Generate the file list, and get the statistics
 my $outputRoot = $exp_tag . '.p3'; # Root output name
-$outputRoot = File::Spec->catpath( $outpath, $outputRoot );
+$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
 $outputRoot = $ipprc->convert_filename_absolute($outputRoot);
 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
