http://www.perlmonks.org?node_id=216329


in reply to Subroutines loaded in from other files

The easiest way is to use the "require" directive. Others will recommend using packages, but you can still go with the less painful solution of "require". A file should like this (eg. functions.pl):
#!/usr/bin/perl sub routine1 { # this routine's code here } sub routine2 { # another routine's code } 1;
Note the "1;" at the bottom. In the main file you need the following line somewhere at the beginning:
require "functions.pl";

--
tune