Name

dump

Synopsis

dump label
                  

During program execution, causes an immediate core dump after code previous to it has already been executed. Primarily, this is so that you can use the undump program to turn your core dump into an executable binary after having initialized all your variables at the beginning of the program. Please note that you shouldn’t use dump( ) or undump( ) with the availability of the Perl Compiler (B modules) as part of your Perl distribution. In addition, you’re unlikely to have success with dump or undump on most modern Unix systems (that support dynamic loading from libdl). dump arranges for the revived binary, when run, to begin by executing a goto label (with all the restrictions that goto suffers). Think of the operation as a goto with an intervening core dump and reincarnation. If label is omitted, the function arranges for the program to restart from the top. Note that any files opened at the time of the dump will no longer be open when the program is reincarnated. See also the -u command-line switch.

As of Perl 5.8, dump is now largely obsolete, partly because it’s difficult to convert a core file into an executable, and because the real compiler backends for generating portable bytecode and compilable C code have superseded it. That’s why you should now invoke it as "CORE::dump( )" if you don’t want to be warned against a possible typo.

The undump program is not available on all systems and may not be compatible with specific ports of Perl.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.