in reply to Building in a Subroutine?
Yes, we call that a module. For example if I have a file functions.pm like this:
package functions; use strict; sub printsomething { print "hello\n"; } 1;
I could use that subroutine in my script like this:
#!/usr/bin/perl use functions; functions::printsomething();
Naturally this isn't all, you can include the module even when it is not in the same directory as your script. Or include it so that you can just use printsomething() instead of functions::printsomething() (by using another module called Exporter in your module).
You can read about modules in one of the perl tutorials or in the reference section perlmod
|
|---|