Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of LTjake (4001)

Saturday June 07, 2003
10:27 AM

GEDCOM stuff.

[ #12683 ]

My family has a website with a fair amount of family information. My father and uncle have taken great care in storing everything in digital format. The family information is all stored in a GEDCOM file.

Unfortunately, the site is run by an extremely OLD perl script. I plan on doing some rewritting eventually adding in features my father and uncle have requested (like the ability to exclude personal information on people still living unless you've logged in, or something to that effect). Thanks to the GEDCOM module on CPAN, this is all quite easy.

I've already posted one GEDCOM script to perlmonks. Here's another quicky that will print a list of surnames in the database and the number of records for each:

use strict;
use Gedcom;

die 'ERROR: No file specified' unless $ARGV[0];
die 'ERROR: File not found' unless -e $ARGV[0];

my $ged = Gedcom->new(
   gedcom_file => $ARGV[0],
   read_only => 1
) or die "ERROR: $!";

my %seen;
$seen{ $_->surname }++ foreach $ged->individuals;

print "$_ [$seen{$_}]\n" foreach sort keys %seen;

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.