dump
dump LABEL
dumpThis function causes an immediate core dump. Primarily this is
so that you can use the undump
program (not supplied) to turn your core dump into an executable binary
after having initialized all your variables at the beginning of the
program. When the new binary is executed it will begin by executing a
goto LABEL
(with all the restrictions that goto
suffers). Think of it as a goto with an intervening core dump and
reincarnation. If LABEL is omitted, the
program is restarted from the top. Warning: any files opened at the time
of the dump will not be open any more when the
program is reincarnated, with possible resulting confusion on the part
of Perl. See also the –u command-line
option in Chapter 17.
This function is now largely obsolete, partly because it’s
difficult to convert a core file into an executable in the general case,
and partly because various compiler backends for generating portable
bytecode and compilable C code have superseded it. However, the people
managing the Perl compiler project (meaning perlcc and friends), hosted on CPAN, report
that dump and undump support may soon be resurrected.
If you’re looking to use dump
to speed up your program, check out the discussion of efficiency matters
in Chapter 21, as well the Perl native-code generator
in Chapter 16. You might also consider autoloading or
selfloading, which at least make your program
appear to run faster.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access