Special subroutines are user defined, but are called by Perl while processing the program. They can be used to change the order in which parts of a program are executed.
The code in block is executed when the program calls an undefined subroutine. $AUTOLOAD
contains the name of the called subroutine, and @_
contains the parameters.
The code in block is executed immediately when compilation of the block is complete.
Executed (in reverse order) when the compilation of the program finishes.
Executed in reverse order when the Perl interpreter terminates. Inside the END blocks, $?
contains the status with which the program is going to exit.
Executed immediately before the Perl interpreter starts executing the program.
Executed (in reverse order) when the compilation of the program unit finishes.