# 'main script' require 'foo.pl'; foo(); # this is the content of foo.pl sub foo{ print"foo" } 1;