Extract _handle_q_command .
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 13 Oct 2012 17:36:17 +0000 (19:36 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:40 +0000 (09:18 -0500)
lib/perl5db.pl

index f10c4ae..0a0b440 100644 (file)
@@ -1743,7 +1743,6 @@ see what's happening in any given command.
 use vars qw(
     $action
     $cmd
-    $fall_off_end
     $file
     $filename_ini
     $finished
@@ -1758,6 +1757,7 @@ our (
     %alias,
     $doret,
     $end,
+    $fall_off_end,
     $incr,
     $laststep,
     $rc,
@@ -2735,11 +2735,7 @@ environment, and executing with the last value of C<$?>.
 
 =cut
 
-                if ($cmd eq 'q') {
-                    $fall_off_end = 1;
-                    clean_ENV();
-                    exit $?;
-                }
+                $obj->_handle_q_command;
 
 =head4 C<t> - trace [n]
 
@@ -3937,6 +3933,18 @@ sub _handle_x_command {
     return;
 }
 
+sub _handle_q_command {
+    my $self = shift;
+
+    if ($DB::cmd eq 'q') {
+        $fall_off_end = 1;
+        DB::clean_ENV();
+        exit $?;
+    }
+
+    return;
+}
+
 package DB;
 
 # The following code may be executed now: