in reply to Data::Dumper segfaulting.

While clearly Data::Dumper shouldn't segfault, the problem is triggered by your use of 'use utf8'; this is in scope during the evals but what you're evalling isn't valid utf8.

Dave.

Replies are listed 'Best First'.
Re^2: Data::Dumper segfaulting.
by nabeel (Novice) on Apr 17, 2007 at 06:31 UTC
    Ok, as Dave suggested, I tried taking 'use utf8' out, but that gives me some really wacky output :
    1:$VAR1 = { 'key' => 'ä, ö, ü / à , Ã, Ã, à ¿Adónde vas?' }; Value is : ä, ö, ü / à , Ã, Ã, à ¿Adónde vas? 2:$VAR1 = { 'key' => 'ä, ö, ü / à , Ã, Ã, à ¿Adónde vas?' }; Value is : ä, ö, ü / à , Ã, Ã, à ¿Adónde vas? 2:$VAR1 = { 'key' => 'ä, ö, ü / à , Ã, Ã, à ¿Adónde vas?' };
    Which I am guessing is just the byte values being shown. Good news is the it doesn't seg, but the characters are not what I want. What would be great if there was a way to take an arbitrarily complex hash structure, which can contain high bit characters, write the dumper of that out to file ( or just get the dumper back in a variable) , eval it back in without any change in information ... seems to be harder than it sounds. But it is certainly making for interesting times :-).
      Well, although its difficult to tell what you expect (since the HTML display of perlmonks may be adding another layer of uft8/bytes display confusion, it looks to me from the above that Data::Dumper is faithfully reproducing what it's being given, but what it's being given isn't what you expect, due to the spurious encode_utf8() that isn't required.

      Dave.

        You are absolutely correct, it does fix the problem very nicely. Thanks a lot.