kane++'s fix for passing @INC down to the restarter child
Yuval Kogman [Wed, 13 Sep 2006 13:02:56 +0000 (13:02 +0000)]
lib/Catalyst/Engine/HTTP.pm

index 60a166d..afc2603 100644 (file)
@@ -199,6 +199,13 @@ sub run {
     if ($restart) {
         $SIG{CHLD} = 'DEFAULT';
         wait;
+
+        ### if the standalone server was invoked with perl -I .. we will loose
+        ### those include dirs upon re-exec. So add them to PERL5LIB, so they
+        ### are available again for the exec'ed process --kane
+        use Config;
+        $ENV{PERL5LIB} .= join $Config{path_sep}, @INC; 
+        
         exec $^X . ' "' . $0 . '" ' . join( ' ', @{ $options->{argv} } );
     }