This seems like a really simple question but somehow my Google-Fu failed me.
What’s the syntax for including functions from other files in Perl? I’m looking for something like C’s #include "blah.h"
I saw the option for using Perl modules, but that seems like it’ll require a not-insignificant rewrite of my current code.
Use a module. Check out perldoc perlmod and Exporter.
In file Foo.pm
In your main program:
Or to get both functions:
You can also import package variables, but the practice is strongly discouraged.