in reply to splitting a source file

You can do something like that:
############## # Main program ############## #!/usr/bin/perl -- package Main; require "mysubs.pm"; # This is my subs Mysubs->foo(); Mysubs->test("this is a test"); ########### # mysubs.pm ########### #!/usr/bin/perl -w -- use strict; package Mysubs; sub foo { if ($_[0] eq "Mysubs") { shift @_; } ## if you call your sub from a +nother file. } sub test { if ($_[0] eq "Mysubs") { shift @_; } ## if you call your sub from an +other file. print $_[0]; }