[LON-CAPA-cvs] cvs: modules /jerf/tests ApacheRequest.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jul 2003 20:31:39 -0000


bowersj2		Thu Jul 17 16:31:39 2003 EDT

  Modified files:              
    /modules/jerf/tests	ApacheRequest.pm 
  Log:
  Preserve "wantarray" across the execInEnv call.
  
  
Index: modules/jerf/tests/ApacheRequest.pm
diff -u modules/jerf/tests/ApacheRequest.pm:1.11 modules/jerf/tests/ApacheRequest.pm:1.12
--- modules/jerf/tests/ApacheRequest.pm:1.11	Tue Jul  8 14:15:15 2003
+++ modules/jerf/tests/ApacheRequest.pm	Thu Jul 17 16:31:39 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Apache Request Simulator
 #
-# $Id: ApacheRequest.pm,v 1.11 2003/07/08 18:15:15 bowersj2 Exp $
+# $Id: ApacheRequest.pm,v 1.12 2003/07/17 20:31:39 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -707,9 +707,15 @@
     my $code = shift;
 
     $self->loadEnv();
-    my $result = &$code();
-    $self->unloadEnv();
-    return $result;
+    if ( wantarray() ) {
+	my @result = &$code();
+	$self->unloadEnv();
+	return @result;
+    } else {
+	my $result = &$code();
+	$self->unloadEnv();
+	return $result;
+    }
 }
 
 =pod