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.
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.