Perl analog to #include "..." ?

M

Miguel Farah

I'm currently working on a program to compute family relationships. A
Perl script reads a GEDCOM (.GED) file and extracts the relevant
information, writing stuff like this:

$father{"1"}="-1"; $mother{"1"}="-2"; $spouses{"1"}=",";
$children{"1"}=","; $sex{"1"}="M"; $name{"1"}="Fred Flintstone";
$father{"2"}="-3"; $mother{"2"}="-4"; $spouses{"2"}=",";
$children{"2"}=","; $sex{"2"}="F"; $name{"2"}="Vilma Flintstone";
$father{"3"}="-5"; $mother{"3"}="-6"; $spouses{"3"}=",";
$children{"3"}=","; $sex{"3"}="F"; $name{"3"}="Pebbles
Rubble-Flintstone";
$father{"4"}="-7"; $mother{"4"}="-8"; $spouses{"4"}=",";
$children{"4"}=","; $sex{"4"}="M"; $name{"4"}="Pete Ecanthropus
Flintstone";
[....]
$spouses{"1"}.="2,"; $spouses{"2"}.="1,";
$father{"3"}="1"; $mother{"3"}="2"; $children{"1"}.="3,";
$children{"2"}.="3,";
$father{"4"}="1"; $mother{"4"}="2"; $children{"1"}.="4,";
$children{"2"}.="4,";
[....]

This output comprises HALF of the source code for a second Perl script,
which is a main code block and a bunch of subroutines that compute and
track relationships.

As you can see, the first half of the source code depends on a
particular GEDCOM file, and needs to be generated each time a new
family
database is used, while the second won't change at all.

I want to keep both halves in separate files, but I don't know exactly
how. If this were PHP or C/C++, I'd just use include() or #include
respectively, but I'm in a stump here. What's the Perl way to do it?


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top