If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

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>

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.