Any pointers?
Simple Module Tutorial
But most simplistic starter for your specific task:
- Put only your subroutine in a file next to the script called "Foo.pm".
- Add a new last line to that file saying just "1;"
- Add a new first line to that file saying "package Foo;"
- Add a first line to your original script saying "use Foo;" *
- Call the subroutine in your original script as "Foo::name_of_that_subroutine"
* ok, not first in this case, but right after the #!/some/path/to/perl -w - line.
Cheers, Sören