On 5/4/17 11:32 PM, Jutta Wrage wrote:
Hi!

I hope this it the right place to get some help using the module.

I have written a little perl program to extract all persons from an exported 
Gedcom file to a tab delimited list. That works well so far.

My problem now is how to get out the marriage names for persons who are 
marriaged.
Is it possible to extract them from the gedcom file using gedcom.pm?

This snippet is from Gedcom::Individual::as_string in gedcal and ged2site. I hope it helps to give you an idea on how to do it.

        my $surname;
        my $sex = get_value({ person => $self, value => 'sex' });
        if(defined($sex) && ($sex eq 'F')) {
            if(my $husband = $self->husband()) {
                $surname = $husband->surname();
                $has_maiden_name = 1;
            } elsif(my $spouse = $self->spouse()) {
                if($opts{'f'}) {
                    die 'married, but no husband relationship';
                }
                if($opts{'w'}) {
red_warning({ person => $self, warning => 'married, but no husband relationship' });
                }
                $surname = $spouse->surname();
                $has_maiden_name = 1;
            }
        }

Jutta

Regards,

-Nigel

--
Nigel Horne
Conductor: Rockville Brass Band, Washington Metropolitan GSO
@nigelhorne | fb/nigel.horne | bandsman.co.uk | concert-bands.co.uk | 
www.nigelhorne.com

Unless it's for my eyes only, please use "reply all"

Reply via email to