NAME

Aion::Meta::Util - helper functions for creating meta data

SYNOPSIS

package My::Meta::Class {
	use Aion::Meta::Util;
	
	create_accessors qw/age/;
	create_getters qw/name/;
}

my $class = bless {name => 'car'}, 'My::Meta::Class';

$class->age(20);
$class->age  # => 20

$class->name  # => car
eval { $class->name('auto') }; $@ # ~> name is ro

DESCRIPTION

Meta-classes that support the creation of features and function signatures (i.e., the internal kitchen of Aion) require their own small implementation, which this module provides.

SUBROUTINES

create_getters (@getter_names)

Creates getters.

create_accessors (@accessor_names)

Creates getter-setters.

subref_is_reachable ($subref)

Checks whether the subroutine has a body.

use Aion::Meta::Util;

subref_is_reachable(\&nouname)             # -> ""
subref_is_reachable(UNIVERSAL->can('isa')) # -> ""
subref_is_reachable(sub {})                # -> 1
subref_is_reachable(\&CORE::exit)          # -> 1

val_to_str ($val)

Converts $val to a string.

Aion::Meta::Util::val_to_str([1,2,{x=>6}])   # => [1, 2, {x => 6}]

Aion::Meta::Util::val_to_str(qr/^[A-Z]/)   # => qr/^[A-Z]/u
Aion::Meta::Util::val_to_str(qr/^[A-Z]/i)   # => qr/^[A-Z]/ui

AUTHOR

Yaroslav O. Kosmina mailto:dart@cpan.org

LICENSE

GPLv3

COPYRIGHT

The Aion::Meta::Util module is copyright © 2025 Yaroslav O. Kosmina. Rusland. All rights reserved.