develooper Front page | perl.perl5.porters | Postings from October 2005

RE: [perl #37350] perlbug AutoReply: $#{@$aref} in debugger gives: Bizarre copy of ARRAY in leave

Thread Next
From:
Lalli, Paul D
Date:
October 4, 2005 15:19
Subject:
RE: [perl #37350] perlbug AutoReply: $#{@$aref} in debugger gives: Bizarre copy of ARRAY in leave
Message ID:
2B450CC60716FA449C8304ED6FBAF2470103E1EA@ex2k.bankofamerica.com
Further examination reveals that the example program originally submitted is far more cluttered than is necessary:

#!/usr/bin/perl
use strict;
use warnings;
 
my $i;
my @a = (1..10);
 
my $last = $#{@a};
print "Last index: $last\n";
 
__END__

Running this program through the debugger produces the "Bizarre copy of ARRAY in leave" error.  Running the program normally (outside the debugger) produces output as though $last had been assigned to $#a.

Please note that removing the { } from @a causes normal execution of the script to produce much more expected results:
Use of $# is deprecated at <file> line 8.
Array found where operator expected at <file> line 8, at end of line
        (Missing operator before ?)
syntax error at <file> line 8, near "$#@a"
Execution of <file> aborted due to compilation errors.


Paul Lalli

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