Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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


Comment on Re: Core Dumping with Arrays
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://31607]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-10-02 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (67 votes), past polls