יובל קוג'מן (Yuval Kogman) > Object-Meta-Plugin-0.01 > Object::Meta::Plugin::Useful::Greedy

Download:
Object-Meta-Plugin-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Object-Meta-Plugin-0.02_04

NAME ^

Object::Meta::Plugin::Useful::Greedy - a plugin base class which gobbles up reasonable parts of the symbol table at export time.

SYNOPSIS ^

        package Foo;

        use base 'Object::Meta::Plugin::Useful::Greedy';

        sub ppretty {
                # ...
        }

        sub ver_pretty {
                # ...
        }

        sub ugly { # will not be exported because of the pattern
                # ...
        }

        sub _filter {
                grep {/pretty/} @_;
        }

DESCRIPTION ^

This is a base class for a pretty standard, pretty easy plugin. When export is called it goes through the symbol table of the plugin's package, as per ref $self, and so forth through all the @ISAs it finds. The functions it finds along the way are collected, and filtered.

METHODS ^

_filter LIST

This takes a list of method names, and munges it into something. The current example will filter things that don't look pretty, that are a bit too general (new, init, croak), and then fishes out duplicates.

You really should define it in your class, if you want more control of the patterns.

CAVEATS ^

BUGS ^

Peh! You must be kididgn!

COPYRIGHT & LICENSE ^

        Copyright 2003 Yuval Kogman. All rights reserved.
        This program is free software; you can redistribute it
        and/or modify it under the same terms as Perl itself.

AUTHOR ^

Yuval Kogman <nothingmuch@woobling.org>

SEE ALSO ^

Object::Meta::Plugin, Object::Meta::Plugin::Useful, Object::meta::Plugin::Useful::Generic, Object::Meta::Plugin::Useful::Meta.

syntax highlighting: