NAME

PersonName::Format::Generic - Internal base class for PersonName::Format objects

SYNOPSIS

package My::Formatter;

use parent qw( PersonName::Format::Generic );

DESCRIPTION

This class provides the common object infrastructure shared by the PersonName::Format distribution.

It implements object construction, error handling, accessors, and a small set of utility methods used internally by the formatter.

It is intentionally lightweight and standalone, allowing the distribution to remain compatible with Perl v5.10.1 and later.

Applications normally do not need to interact with this class directly.

METHODS

new

my $obj = Some::Class->new( %options );

Creates a new object.

init

$obj->init( %options );

Object initialisation hook invoked by "new".

Subclasses may override this method.

error

my $exception = $obj->error;

$obj->error( "Something went wrong" );

Gets or sets the last exception associated with the object.

pass_error

return $self->pass_error( $other );

Copies the error state from another object or exception and returns the appropriate failure value.

fatal

my $bool = $obj->fatal;

Returns whether fatal exceptions are enabled.

debug

my $bool = $obj->debug;

Returns whether debug mode is enabled.

INTERNAL METHODS

The following methods are intended for use by subclasses.

_can

_get_args_as_hash

_set_get_scalar

These methods are not considered part of the public API and may change in future releases.

SEE ALSO

PersonName::Format, PersonName::Format::Exception

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.