NAME

PersonName::Format::Name - Base contract for person-name providers

SYNOPSIS

package My::Name;
use parent qw( PersonName::Format::Name );

sub get_field_value
{
    my( $self, $field, $modifiers ) = @_;
    ...
}

DESCRIPTION

This class defines the internal contract used by PersonName::Format. Applications may subclass it or provide any object implementing get_field_value(), name_locale(), and preferred_order().

Internally, field names use underscore-separated Perl identifiers. CLDR field names using hyphens are converted only at the formatter boundary.

METHODS

external_field_name

Maps an internal Perl field name such as surname_core to the corresponding CLDR-facing name surname-core.

get_field_value

Must be implemented by a concrete name provider.

implements_name_contract

PersonName::Format::Name->implements_name_contract( $object );
$name->implements_name_contract( $object );

Returns true when the supplied object implements the required name contract: it must be a blessed reference that provides get_field_value(), name_locale(), and preferred_order(). This method may be called as a class method or as an instance method; both forms are equivalent.

internal_field_name

Maps CLDR-facing and supported convenience aliases to their internal underscore-separated field name.

name_locale

Returns the locale associated with the name.

preferred_order

Returns givenFirst, surnameFirst, or an undefined value.

AUTHOR

Jacques Deguest <jack@deguest.jp>

COPYRIGHT & LICENSE

Copyright(c) 2026 DEGUEST Pte. Ltd.

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.