Begin and End block
#!/usr/bin/perl use warnings; use strict; END { print "Exiting... \n"; } print "Running! \n"; fun(); sub fun { print "Inside fun \n"; } BEGIN { print "Compiling... \n"; }