The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Sub::Meta::CreatorFunction - utilities to create Sub::Meta

SYNOPSIS

    use Sub::Meta::CreatorFunction;

    sub hello { }
    my $meta = Sub::Meta::CreatorFunction::find_submeta(\&hello);

DESCRIPTION

This module tries to create Sub::Meta from a subroutine in the way it is under Sub::Meta::Finder, or from Sub::Meta::Library.

FUNCTIONS

find_submeta($sub)

    find_submeta(CodeRef $sub) => Maybe[Sub::Meta]

Return submeta of subroutine.

finders

    finders() => ArrayRef[CodeRef]

Return arrayref of Sub::Meta::Finder::*::find_materials.

CUSTOMIZE

@FINDER_CLASSES

You can change @FINDER_CLASSES:

    local @Sub::Meta::CreatorFunction::FINDER_CLASSES = qw(MySubMeta::Finder);
    my $meta = Sub::Meta::CreatorFunction::find_submeta(\&hello); # find by MySubMeta::Finder

Note that once find_submeta is called, the finders will be fixed by state.

LICENSE

Copyright (C) kfly8.

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

AUTHOR

kfly8 <kfly@cpan.org>