Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Where did __DIE__ go? (Data::Dumper bug?)

by missingthepoint (Friar)
on Jun 27, 2009 at 08:37 UTC ( [id://775272]=perlquestion: print w/replies, xml ) Need Help??

missingthepoint has asked for the wisdom of the Perl Monks concerning the following question:

Howdy all,

While messing about with signals recently I noticed this:

C:\Src>perl -MDDS -e "Dump \%SIG" $HASH1 = { __DIE__ => undef, __WARN__ => undef, ABRT => undef, ALRM => undef, BREAK => undef, CHLD => undef, CLD => undef, CONT => undef, FPE => undef, HUP => undef, ILL => undef, INT => undef, KILL => undef, NUM05 => undef, NUM06 => undef, NUM07 => undef, NUM10 => undef, NUM12 => undef, NUM16 => undef, NUM17 => undef, NUM18 => undef, NUM19 => undef, NUM24 => undef, PIPE => undef, QUIT => undef, SEGV => undef, STOP => undef, TERM => undef }; C:\Src>perl -MData::Dumper -e "print Dumper \%SIG" $VAR1 = { 'ABRT' => undef, 'BREAK' => undef, 'HUP' => undef, 'NUM19' => undef, 'FPE' => undef, 'CLD' => undef, 'NUM12' => undef, 'NUM16' => undef, 'NUM18' => undef, 'NUM17' => undef, 'STOP' => undef, 'NUM24' => undef, 'NUM10' => undef, 'INT' => undef, 'SEGV' => undef, 'QUIT' => undef, 'KILL' => undef, 'PIPE' => undef, 'NUM05' => undef, 'CONT' => undef, '__WARN__' => undef, 'NUM06' => undef, 'NUM07' => undef, 'ILL' => undef, 'TERM' => undef, 'ALRM' => undef, 'CHLD' => undef }; C:\Src>

In the Data::Dumper output, the entry in the %SIG hash for __DIE__ is missing, but when using Data::Dump::Streamer it appears. I suspect DDS is correct.

1. Is DDS indeed correct? 2. If so, why is __DIE__ missing in the latter? This is mainly curiosity on my part.

For info, This is perl, v5.10.0 built for MSWin32-x86-multi-thread Binary build 1004 (287188) provided by ActiveState

Update: and Data::Dump::Streamer $VERSION='2.09' $XS_VERSION='2.07', Data::Dumper $VERSION=2.121_14

Thanks for any insight! :)


undef $lunches{free}

Replies are listed 'Best First'.
Re: Where did __DIE__ go? (Data::Dumper bug?)
by BrowserUk (Patriarch) on Jun 27, 2009 at 08:48 UTC

    Maybe DDS or something used by it installs (and later removes) a DIE handler, leaving the key but undefing the value?

    Update:Seems to be the case:

    c:\test>perl -MData::Dump::Streamer -MData::Dumper -E"say Dumper \%SIG +" $VAR1 = { 'ABRT' => undef, 'BREAK' => undef, 'HUP' => undef, 'NUM19' => undef, 'FPE' => undef, 'CLD' => undef, 'NUM12' => undef, 'NUM16' => undef, '__DIE__' => undef, 'NUM18' => undef, 'NUM17' => undef, 'STOP' => undef, 'NUM24' => undef, 'NUM10' => undef, 'INT' => undef, 'SEGV' => undef, 'QUIT' => undef, 'KILL' => undef, 'PIPE' => undef, 'NUM05' => undef, 'CONT' => undef, '__WARN__' => undef, 'NUM06' => undef, 'NUM07' => undef, 'ILL' => undef, 'TERM' => undef, 'ALRM' => undef, 'CHLD' => undef };

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      ++. This makes sense.


      undef $lunches{free}
Re: Where did __DIE__ go? (Data::Dumper bug?)
by FunkyMonk (Chancellor) on Jun 27, 2009 at 08:50 UTC
    I suspect you've got it the wrong way round:

    $ perl -E 'say "$_ => $SIG{$_}" for sort {$a cmp $b} keys %SIG' ABRT => ALRM => BUS => CHLD => CLD => CONT => FPE => IGNORE HUP => ... UNUSED => URG => USR1 => USR2 => VTALRM => WINCH => XCPU => XFSZ =>

    and

    $ perl -MData::Dumper -E 'say "$_ => $SIG{$_}" for sort {$a cmp $b} ke +ys %SIG' #snip much the same as above, except for... __WARN__ =>

    I don't have Data::Dump::Streamer installed, so I didn't try that. This was using Perl 5.10.0 on Debian.

Re: Where did __DIE__ go? (Data::Dumper bug?)
by Anonymous Monk on Jun 27, 2009 at 08:45 UTC
    It was never there
    perl -le " print for sort keys %SIG " ABRT ALRM BREAK CHLD CLD CONT FPE HUP ILL INT KILL NUM05 NUM06 NUM07 NUM10 NUM12 NUM16 NUM17 NUM18 NUM19 NUM24 PIPE QUIT SEGV STOP TERM

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://775272]
Approved by Marshall
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found