Re: [perl #3177] perl -d treats $array[0..3] differently than non-debugger

2005-07-15 Thread Jeff 'japhy' Pinyan

On Jul 13, Michael G Schwern said:


On Wed, Jul 13, 2005 at 10:12:25AM +0200, Rafael Garcia-Suarez wrote:

On 7/13/05, Michael G Schwern via RT [EMAIL PROTECTED] wrote:

main::(-e:1):   0
  DB1 @a = qw(A B C);

  DB2 x $a[0..3], $a[1..3]


Surely you mean @a[0..3] here.


Just replicating what the bug claimed.

 main::(-e:1): 0
 DB1 @a = qw( A B C );

 DB2 x $a[0..3], $a[1..3]
 0 'B'
 1 'A'


Perhaps it behaves differently because $.'s value in the debugger is 
different from $.'s value in the program when it's run normally?


Since that is what $a[0..3] and $a[1..3] depend on.

--
Jeff japhy Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


Re: [perl #3177] perl -d treats $array[0..3] differently than non-debugger

2005-07-13 Thread Rafael Garcia-Suarez
On 7/13/05, Michael G Schwern via RT [EMAIL PROTECTED] wrote:
 main::(-e:1):   0
   DB1 @a = qw(A B C);
 
   DB2 x $a[0..3], $a[1..3]

Surely you mean @a[0..3] here.


Re: [perl #3177] perl -d treats $array[0..3] differently than non-debugger

2005-07-13 Thread Michael G Schwern
On Wed, Jul 13, 2005 at 10:12:25AM +0200, Rafael Garcia-Suarez wrote:
 On 7/13/05, Michael G Schwern via RT [EMAIL PROTECTED] wrote:
  main::(-e:1):   0
DB1 @a = qw(A B C);
  
DB2 x $a[0..3], $a[1..3]
 
 Surely you mean @a[0..3] here.

Just replicating what the bug claimed.

  main::(-e:1): 0
  DB1 @a = qw( A B C );

  DB2 x $a[0..3], $a[1..3]
  0 'B'
  1 'A'


-- 
Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern
Don't try the paranormal until you know what's normal.
-- Lords and Ladies by Terry Prachett


[perl #3177] perl -d treats $array[0..3] differently than non-debugger

2005-07-12 Thread Michael G Schwern via RT
The debugger no longer sets $.

$ perl -de 0

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   0
  DB1 print $.

  DB2 

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
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   0
  DB1 @a = qw(A B C);

  DB2 x $a[0..3], $a[1..3]
0  'B'
1  'A'
  DB3 

$ perl -wle '@a = qw(A B C);  print $a[0..3], $a[1..3]'
Use of uninitialized value in range (or flip) at -e line 1.
Use of uninitialized value in range (or flop) at -e line 1.
Use of uninitialized value in range (or flip) at -e line 1.
Argument  isn't numeric in array element at -e line 1.
BA