Jump to content

Perl Programming/Keywords/END

From Wikibooks, open books for an open world
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Previous: elsif Keywords Next: endgrent

The END keyword

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

 END BLOCK 

See also

Previous: elsif Keywords Next: endgrent