Separating out common code
Suppose I have a bunch of Perl scripts and they all need some code lines that will be identical in every script. Is there anything similar to #include as seen in C and C++?
In this particular case, the lines would be data variables - so I'd be looking for something equivalent to #include <whatever.h>. However, if the lines were in fact, executable functions, it might be useful to have something equivalent to #include <whatever.c>
Any way to do this kind of thing with Perl?
Re: Separating out common code
Any reason why you don't just use require?
Re: Separating out common code
Thanks, tha's exactly what I was looking for!
I'm following one of those "Teach Yourself" books and I'd scoured the index looking for words like "include", "import", "sources", "modules" etc etc but I couldn't find any clue. "require" is what I wanted. :thumb: