-
April 22nd, 2013, 01:28 AM
#1
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?
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
April 22nd, 2013, 11:49 AM
#2
Re: Separating out common code
Any reason why you don't just use require?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 23rd, 2013, 02:40 AM
#3
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.
"A problem well stated is a problem half solved.” - Charles F. Kettering
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|