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

First off, I'm a newbie to perl. I've only been at it for a seven or eight months, but I've read most of the books and I make sure to check out The Monastery atleast once a day.

I'm working on a program today and decided it would be good practice to put my html header and footer into subroutines so I wasn't wasting space and time. Not really thinking too much of it, I called one of my subroutines "header" and inside that sub I called for a print header; to get ready to print to the browser.(yeah, I know...) I quickly figured out the problem, but it created a file I don't fully understand. In the few seconds it was running it created a file called script.pl.core which was somewhere on the order of 750MB. I ran a super search looking for info, but returned nothing. Could someone clue me in on what this file was?

Thanks.

Replies are listed 'Best First'.
Re: Another Lesson Learned (but needs clarification.)
by Biker (Priest) on Feb 12, 2002 at 07:06 UTC

    Without having seen the code it's difficult to give an exact explanation, but it seems like you called header and in header you print header, that first will expand the code and thereby print header, that first will expand the code and thereby print header, that first will expand the code and thereby print header, and so on...

    Sooner or later the program run out of (memory?) resources and dumped core.


    Everything will go worng!

Re: Another Lesson Learned (but needs clarification.)
by dragonchild (Archbishop) on Feb 11, 2002 at 22:10 UTC
    Core files are usually only created when the program crashes. Did it crash??

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      Yes, it did.
        Your core file is simply an image of your computer's memory when the crash happened. You can delete it or look at it using the strings command.

        metadoktor

        "The doktor is in."