develooper Front page | perl.perl5.porters | Postings from March 2000

Re: rcfile ordering in debugger

Thread Previous
From:
Tom Christiansen
Date:
March 15, 2000 08:21
Subject:
Re: rcfile ordering in debugger
Message ID:
7249.953137304@chthon
>This seems to better match expected usage and desirable properties.
>Can anybody think of any good reason why the debugger should not
>be fixed to work this way?  (Actually, I've already got the patch,
>but wanted to run the idea by the world first.)

Well, I've heard nothing, so here's the patch that implements this.

--- perl5db.pl-presig	Tue Mar 14 18:42:13 2000
+++ perl5db.pl	Wed Mar 15 06:23:49 2000
@@ -346,16 +346,24 @@
     return 1;
 }
 
-if (-f $rcfile) {
-    safe_do("./$rcfile");
-} 
-elsif (defined $ENV{HOME} && -f "$ENV{HOME}/$rcfile") {
+{ 
+    my @sb;	# stat buff to check duplicate loading
+    if (defined $ENV{HOME} && -f "$ENV{HOME}/$rcfile") {
+	@sb = stat(_);
     safe_do("$ENV{HOME}/$rcfile");
-}
-elsif (defined $ENV{LOGDIR} && -f "$ENV{LOGDIR}/$rcfile") {
+    }
+    elsif (defined $ENV{LOGDIR} && -f "$ENV{LOGDIR}/$rcfile") {
+	@sb = stat(_);
     safe_do("$ENV{LOGDIR}/$rcfile");
-} 
+    } 
 
+    if (-f $rcfile) {
+	if (@sb && $sb[0] != (stat _)[0] && $sb[1] != (stat _)[1]) { 
+	    safe_do("./$rcfile");
+	}
+    } 
+
+}
 if (defined $ENV{PERLDB_OPTS}) {
     parse_options($ENV{PERLDB_OPTS});
 }

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About