Perl Programming/Keywords/END

Previous: elsif Keywords Next: endgrent

The END keyword edit

END is one of five code blocks that are executed at the beginning and end of a program by Perl. It creates the block that is executed short before the Perl interpreter stops execution. This block is even executed after a die operation, but not after an exec or when killed by a OS signal.

Although it can be prefixed with sub, this is not considered a good programming practice, as these blocks are not a subroutine.

Syntax edit


See also edit

Previous: elsif Keywords Next: endgrent