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


in reply to Splitting program into modules

I have written a little sub that includes other files in your perl code. And I think, it's exactly what you need. Just try it and see if it works:

include('database.pl');

OR

my $whatever = include('getTime.pl');

...

sub include{open my$H,'<:raw',$_[0];read($H,my$E,999999)or die"Error: Can't include \"$_[0]\"";close$H;eval$E;}