Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Core Dumping with Arrays

by reptile (Monk)
on Sep 08, 2000 at 19:50 UTC ( #31607=note: print w/replies, xml ) Need Help??

in reply to Core Dumping with Arrays

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($&)) }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://31607]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-11-23 12:28 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (334 votes). Check out past polls.