-
Notifications
You must be signed in to change notification settings - Fork 578
perl -d treats $array[0..3] differently than non-debugger #1907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]This is with perl5.005_02, by the way... jeffp@friday [11:05pm] ~ #543> perl -de0 Loading DB routines from perl5db.pl version 1.0401 Enter h or `h h' for help. main::(-e:1): 0 DB<2> x $a[0..3], $a[1..3] perl -le '@a = qw( A B C ); print $a[0..3], $a[1..3];' Could someone explain this? :( Hmm... perhaps $. is defined in the |
From @tamiasOn Thu, Apr 27, 2000 at 11:07:15PM -0400, Jeff Pinyan wrote:
In 5.005_3, I only get that result with: % perl -de 'BEGIN{@a = qw( A B C )} 1'
Or, if you're being picky: AA :)
Yes, and the most recently read file handle is STDIN. This quirk of the Ronald |
From [Unknown Contact. See original ticket]On Apr 27, Ronald J Kimball said:
Um, does the BEGIN have anything special to do with it?
Err, yeah. I knew the output, so it just follows logically that I write $brain |= TURN_ON;
Indeed it is -- I just found it out now. How annoying that can be. |
From @tamiasOn Thu, Apr 27, 2000 at 11:16:38PM -0400, Jeff Pinyan wrote:
No, it's just that the first command needs to be C<x $a[0..3], $a[1..3]> Ronald |
From [Unknown Contact. See original ticket]On Apr 27, Ronald J Kimball said:
jeffp@friday [11:21pm] ~ #551> perl -de0 Loading DB routines from perl5db.pl version 1.0401 Enter h or `h h' for help. print $.main::(-e:1): 0 |
From @tamiasOn Thu, Apr 27, 2000 at 11:22:08PM -0400, Jeff Pinyan wrote:
% perl -de 0 Loading DB routines from perl5db.pl version 1.0402 Enter h or `h h' for help. main::(-e:1): 0 (perl5.005_03) I would say "time to upgrade", but I don't know that this is a significant Anyway, I don't have access to v5.6.0 right now, so I can't check what it Ronald |
From @simoncozens
main::(-e:1): 42 __END__ The information transmitted is intended only for the person or entity to |
From [Unknown Contact. See original ticket]
rabbit% perl5.6.0 -de 0 Loading DB routines from perl5db.pl version 1.07 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<2> print $. |
From [Unknown Contact. See original ticket]
Ok, so I assume perl5db.pl is a different version (> 1.0401). Does this new version have the correct documentation in the following # The scalar ${'_<'.$filename} contains "_<$filename". That should read # The scalar ${'_<'.$filename} contains "$filename". or perhaps # The scalar ${'_<'.$filename} contains $filename. But I'd go with the first, for continuity reasons. Not having 5.005_03 or |
From @simoncozens
Yeah, this is 1.07
Inline Patch--- lib/perl5db.pl~ Fri Apr 28 12:55:46 2000
+++ lib/perl5db.pl Fri Apr 28 12:56:00 2000
@@ -34,7 +34,7 @@
# interpreter, though the values used by perl5db.pl have the form
# "$break_condition\0$action". Values are magical in numeric context.
#
-# The scalar ${'_<'.$filename} contains "_<$filename".
+# The scalar ${'_<'.$filename} contains "$filename".
#
# Note that no subroutine call is possible until &DB::sub is defined
# (for subroutines defined outside of the package DB). In fact the same is
The information transmitted is intended only for the person or entity to |
From [Unknown Contact. See original ticket]Stephen Zander <gibreel@pobox.com> wrote
Hmmm... Something very odd is happening here. I get the output Anyhow, with the attached patch (for 5.6.0), all of this behaviour should Mike Guy Inline Patch--- ./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 |
From [Unknown Contact. See original ticket]
I have Term::ReadKey and Term::ReadLine::Perl installed Mike> Anyhow, with the attached patch (for 5.6.0), all of this With your patch I now get: rabbit% perl5.6.0 -de 0 Loading DB routines from perl5db.pl version 1.07 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<2> print $. DB<3> print $. DB<4> print $. DB<5> Is that what should have happened? |
From [email protected][RT_System - Sat Apr 29 02:53:42 2000]:
Yes. $. isn't actually defined until something gets read from STDIN in the program being joe% perl -de 'while(<STDIN>){print}' Loading DB routines from perl5db.pl version 1.07 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): while(<STDIN>){print} DB<2> s The behavior should probably be documented specifically. |
From @schwernThe debugger no longer sets $. $ perl -de 0 Loading DB routines from perl5db.pl version 1.28 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<2> The code works the same in the debugger as it does on the command line: $ perl -de 0 Loading DB routines from perl5db.pl version 1.28 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<2> x $a[0..3], $a[1..3] $ perl -wle '@a = qw(A B C); print $a[0..3], $a[1..3]' |
@schwern - Status changed from 'open' to 'resolved' |
From @rgarciaOn 7/13/05, Michael G Schwern via RT <perlbug-followup@perl.org> wrote:
Surely you mean @a[0..3] here. |
From @schwernOn Wed, Jul 13, 2005 at 10:12:25AM +0200, Rafael Garcia-Suarez wrote:
Just replicating what the bug claimed. main::(-e:1): 0 DB<2> x $a[0..3], $a[1..3] -- |
From [email protected]On Jul 13, Michael G Schwern said:
Perhaps it behaves differently because $.'s value in the debugger is Since that is what $a[0..3] and $a[1..3] depend on. -- |
Migrated from rt.perl.org#3177 (status was 'resolved')
Searchable as RT3177$
The text was updated successfully, but these errors were encountered: