Gedcom.pm
Gedcom.pm copied to clipboard
Need help: nsfx
How do I get to the nsfx value of a person? I've tried these methods and none of them works:
# $person is a 'Gedcom::Individual' object
print $person->name(), "\n";
my $nsfx = $person->nsfx();
if($nsfx) {
die $nsfx;
}
$nsfx = $person->tag_record('NSFX');
if($nsfx) {
die $nsfx;
}
$nsfx = $person->get_value('NSFX');
if($nsfx) {
die $nsfx;
}
Here's a snippet from the Gedcom:
0 @I321@ INDI 1 NAME Arthur George /Barton/ 2 GIVN Arthur George 2 SURN Barton 2 NSFX OBE 2 _PRIM Y
The same is true for npfx. I can't fathom how to get "Cpl" from this person.
0 @I3722@ INDI
1 NAME Henry Lewis /Horne/
2 NPFX Cpl
2 GIVN Henry Lewis
2 SURN Horne
2 _PRIM Y
You should be able to get the two values with code such as:
my $i1 = $ged->get_individual("I321");
my $nsfx = $i1->get_value("NAME NSFX");
my $i2 = $ged->get_individual("I3722");
my $npfx = $i2->get_value("NAME NPFX");
Yes - that works, thanks