in reply to Core Dumping with Arrays

In Data::Dumper::_dump(), if this:
my($s, $val, $name) = @_;

is changed to this:

my $s = shift;
my $val = shift;
my $name = shift;

then it all seems to work. It would be nice if the whole thing were rewritten to work with 'use strict'.

Replies are listed 'Best First'.
RE (tilly) 2 (you got it!): Core Dumping with Arrays
by tilly (Archbishop) on Sep 09, 2000 at 15:16 UTC
    You are right! Here is a patch:
    --- /usr/local/lib/perl5/5.00503/Data/Dumper.pm Fri May 28 18:34:02 19 +99 +++ Dumper.pm Fri Sep 8 19:55:37 2000 @@ -204,7 +204,9 @@ # and recurse, of course. # sub _dump { - my($s, $val, $name) = @_; + my $s = shift; + my $val = shift; + my $name = shift; my($sname); my($out, $realpack, $realtype, $type, $ipad, $id, $blesspad);
    In Perl 5.6.0 the code was not patched, instead they made this line work properly. Does anyone know the exact bug that is being tripped across here?
      I not sure if it has anything to do with it, but there is a bug where if perl tries to create an array of a certain range of very large sizes, it core dumps instead of a nice 'Out of memory' error. You can search p5p for 'pseudohash' because at first I thought it had to do with pseudo hash arrays, but later found it could happen with any array.