Extract _restore_globals_after_restart.
authorShlomi Fish <shlomif@shlomifish.org>
Sun, 30 Sep 2012 14:14:15 +0000 (16:14 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:29 +0000 (09:18 -0500)
lib/perl5db.pl

index a7db086..6782246 100644 (file)
@@ -1413,6 +1413,21 @@ sub _restore_options_after_restart
     return;
 }
 
+sub _restore_globals_after_restart
+{
+    # restore original @INC
+    @INC     = get_list("PERLDB_INC");
+    @ini_INC = @INC;
+
+    # return pre/postprompt actions and typeahead buffer
+    $pretype   = [ get_list("PERLDB_PRETYPE") ];
+    $pre       = [ get_list("PERLDB_PRE") ];
+    $post      = [ get_list("PERLDB_POST") ];
+    @typeahead = get_list( "PERLDB_TYPEAHEAD", @typeahead );
+
+    return;
+}
+
 if ( exists $ENV{PERLDB_RESTART} ) {
 
     # We're restarting, so we don't need the flag that says to restart anymore.
@@ -1433,15 +1448,7 @@ if ( exists $ENV{PERLDB_RESTART} ) {
     # restore options
     _restore_options_after_restart();
 
-    # restore original @INC
-    @INC     = get_list("PERLDB_INC");
-    @ini_INC = @INC;
-
-    # return pre/postprompt actions and typeahead buffer
-    $pretype   = [ get_list("PERLDB_PRETYPE") ];
-    $pre       = [ get_list("PERLDB_PRE") ];
-    $post      = [ get_list("PERLDB_POST") ];
-    @typeahead = get_list( "PERLDB_TYPEAHEAD", @typeahead );
+    _restore_globals_after_restart();
 } ## end if (exists $ENV{PERLDB_RESTART...
 
 =head2 SETTING UP THE TERMINAL