############## # 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]; }
In reply to Re: splitting a source file
by Oden
in thread splitting a source file
by kevind0718
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |