#!/usr/bin/perl BEGIN { print "1st BEGIN\n" } BEGIN { print "2nd BEGIN\n" } BEGIN { print "\n" } INIT { print "1st INIT\n" } INIT { print "2nd INIT\n" } INIT { print "\n" } CHECK { print "1st CHECK\n" } CHECK { print "2nd CHECK\n" } CHECK { print "\n" } print "1st code\n" ; print "2nd code\n" ; print "\n" ; exit; END { print "1st END\n" } END { print "2nd END\n" } END { print "\n" } #### # begin output - this line not really printed by code above 1st BEGIN 2nd BEGIN 2nd CHECK 1st CHECK 1st INIT 2nd INIT 1st code 2nd code 2nd END 1st END # end output - this line not really printed by code above