Recently, a bug was reported on p5p that the following one-liner causes a SIGABRT and a core dump: perl -duse strict Q: Why does this script cause perl to dump core?

The object of this quiz is not to see if you can answer the question off the top of your head, although there may be a handful of people who can (I would not be one of them :) . Rather, the object is to see if you can figure out the answer. (Without looking up the responses to the bug report, of course!)

[Original bug report]

Replies are listed 'Best First'.
Re (tilly) 1: (Quiz) Why does this one-liner cause a core dump?
by tilly (Archbishop) on Oct 23, 2001 at 23:42 UTC
    Heh. Obvious once you look up what all of the command line flags do according to perlrun.

    HINT: It is not a bug, it is documented along with the reason for the feature. :-)

Re: (Quiz) Why does this one-liner cause a core dump?
by japhy (Canon) on Oct 23, 2001 at 23:44 UTC
    perl -d -u -s -e 'strict'

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Re: (Quiz) Why does this one-liner cause a core dump?
by blakem (Monsignor) on Oct 23, 2001 at 23:43 UTC
    Looks like I can whittle that down to:
    perl -u -e 1 Aborted (core dumped)
    Then check perlrun to find your answer.... ;-)

    -Blake

Re: (Quiz) Why does this one-liner cause a core dump? (boo)
by boo_radley (Parson) on Oct 24, 2001 at 00:04 UTC
    even more confusing, what about perl -d use strict? This seems to run part of the last perl script I ran...
    wait...
    update no, really. I don't understand what this does; it seems to want to process a text file; what's its logic?
Re: (Quiz) Why does this one-liner cause a core dump?
by mpeppler (Vicar) on Oct 24, 2001 at 21:20 UTC
    perl sees -du, which causes the process to get "dumped".

    Obvious to this long-time perl user :-)

    Michael

Re: (Quiz) Why does this one-liner cause a core dump?
by lestrrat (Deacon) on Oct 24, 2001 at 03:32 UTC

    Oh, duh... god, it took me forever to figure out... /me feels stupid