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

[PATCH] Re: [ID 20000427.007] perl -d treats $array[0..3] differently than non-debugger

Thread Next
From:
M.J.T. Guy
Date:
April 29, 2000 06:07
Subject:
[PATCH] Re: [ID 20000427.007] perl -d treats $array[0..3] differently than non-debugger
Message ID:
E12lWy2-0003B8-00@taurus.cus.cam.ac.uk
Stephen Zander <gibreel@pobox.com> wrote
> 
> >>>>> "Ronald" == Ronald J Kimball <rjk@linguist.dartmouth.edu> writes:
>     Ronald> Anyway, I don't have access to v5.6.0 right now, so I
>     Ronald> can't check what it does there.
> 
> rabbit% perl5.6.0 -de 0
> Default die handler restored.
> 
> Loading DB routines from perl5db.pl version 1.07
> Editor support available.
> 
> Enter h or `h h' for help, or `man perldebug' for more help.
> 
> main::(-e:1):   0
>   DB<1> print $.
> 
>   DB<2> print $.
> 0
>   DB<3> print $.
> 0
>   DB<4> print $.
> 0
>   DB<5> print $.
> 0

Hmmm...  Something very odd is happening here.    I get the output
1, 2, 3 ... on all versions of Perl5, while you and Jeff get zeroes.
Ah!   I'll bet you've got different variants of Term::whatever installed.

Anyhow, with the attached patch (for 5.6.0), all of this behaviour should
go away.


Mike Guy

--- ./lib/perl5db.pl.orig	Sun Mar 19 06:26:25 2000
+++ ./lib/perl5db.pl	Sat Apr 29 13:54:01 2000
@@ -1698,8 +1698,6 @@
 }
 
 sub gets {
-    local($.);
-    #<IN>;
     &readline("cont: ");
 }
 
@@ -1804,6 +1802,7 @@
 }
 
 sub readline {
+  local $.;
   if (@typeahead) {
     my $left = @typeahead;
     my $got = shift @typeahead;

End of patch

Thread Next


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