in reply to Re: Why are list items passed to die() combined into a string?
in thread Why are list items passed to die() combined into a string?

Thanks, that verifies what I see. I had read the article that node was in response to but I didn't make it down that far. Another node states that die() is just doing what print() does and concatenates its inputs for display.

Update:

I found the following at General Variables in the %SIG section:

The routine indicated by $SIG{__DIE__} is called when a fatal exception is about to be thrown. The error message is passed as the first argument.

Replies are listed 'Best First'.
Re^3: Why are list items passed to die() combined into a string?
by kennethk (Abbot) on Jan 13, 2015 at 19:25 UTC
    Thing to note: neither $" or $, will impact the concatenation seen by $SIG{__DIE__}(e.g. join '', @_). This contrasts print, where print "@_" or print @_ can have their behavior impacted.

    I far prefer overriding die to working with $SIG{__DIE__} myself, since the latter's behavior isn't what I usually actually want to impact.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      Ah, good point. Overriding functions will be my next project.

      I had considered using "@_" to pass to my email routine just to let my future self know it needs to be a single string. But since @_ has already been concatenated that doesn't make sense. Now I'm thinking passing $_[0] might be better.