NAME

PersonName::Format::SimpleName - Simple person-name value object

SYNOPSIS

my $name = PersonName::Format::SimpleName->new(
    nameLocale       => 'en-GB',
    preferredOrder   => 'givenFirst',
    given            => 'John',
    given2           => 'Ronald Reuel',
    'given-informal' => 'Johnny',
    surname          => 'Tolkien',
);

my $modifiers = { informal => 1 };
my $given = $name->get_field_value( 'given', $modifiers );

DESCRIPTION

This class is the standard in-memory implementation of the PersonName::Format::Name contract.

It accepts a hash reference or a flat key/value list. Public input may use CLDR-facing hyphenated names, underscore-separated Perl names, or the documented camelCase convenience aliases. Internally all fields use underscore-separated names.

NAME FIELDS

title
given
given2
given_informal
surname
surname2
surname_prefix
surname_core
generation
credentials

METHODS

as_hash

Returns a plain hash reference using internal underscore-separated field names.

fields

Returns the supported internal name fields.

get_field_value

Returns a field value and consumes any modifiers that this name object resolves itself from the supplied mutable hash reference.

informal, prefix, and core are handled by this class. Modifiers left in the hash are intended to be applied by the formatter.

has_field

Returns true when the requested field exists and is defined.

name_locale

Gets or sets the name locale as a Locale::Unicode object.

preferred_order

Gets or sets givenFirst or surnameFirst.

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.