############## # 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 another file. } sub test { if ($_[0] eq "Mysubs") { shift @_; } ## if you call your sub from another file. print $_[0]; }