in reply to Running another script within CGI

Any pointers?

Simple Module Tutorial

But most simplistic starter for your specific task:

  1. Put only your subroutine in a file next to the script called "Foo.pm".
  2. Add a new last line to that file saying just "1;"
  3. Add a new first line to that file saying "package Foo;"
  4. Add a first line to your original script saying "use Foo;" *
  5. 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