Running 5.00502 I got the same thing. I looked a little further into it out of curiosity. Dumper does an odd thing if it gets something that's not a reference: it makes it a reference and tries again. This is the problem right here. A slightly different approach:
my @comps; $comps[10] = "foo bar"; my $foo = \$comps[0]; my $bar = \$comps[5]; my $baz = \$comps[10]; print "$foo $bar $baz\n"; __END__ UNKNOWN(0x813e940) UNKNOWN(0x813eac8) SCALAR(0x80c84b4) Attempt to free unreferenced scalar. Attempt to free unreferenced scalar. Attempt to free unreferenced scalar. Attempt to free unreferenced scalar. Segmentation fault (core dumped)
Dumper is trying to take a reference to an undefined value here, and that's apparently not something the 5.005 series likes too much. I'm not sure at all what's causing the core dump. If I simply dump @comps the first time and exit, it prints a bunch of "Attempt to free unreferenced scalar" messages but doesn't core dump. If I remove the Dumper line too, it works just fine.
This is a problem both with perl and with Data::Dumper, and I suspect a bug report should go to both. 5.005* loathes references to undef and Dumper makes references to undef.
local $_ = "0A72656B636148206C72655020726568746F6E41207473754A"; while(s/..$//) { print chr(hex($&)) }
In reply to Re: Core Dumping with Arrays
by reptile
in thread Core Dumping with Arrays
by btrott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |