#!/usr/bin/perl
sub blah{
code
code
code
code
code
}
Then in another script I would like to be able to call that subroutine. Do I need more in the file with the subroutine or what do I need to do to accomplish this?
Thanks
D O N
do [perldoc.com] EXPR uses the value of EXPR as a filename and executes the contents of the file as a Perl [perl.com] script. Its primary use is to include subroutines from a Perl [perl.com] subroutine library.
In Perl [perl.com] 5 it is more common, however, to use [perldoc.com] a module. Just create a file named MyModule.pm and then
[url=http://www.perldoc.com/perl5.8.0/pod/func/use.html]use[/url] MyModule; in your code. Andreas