DESCRIPTION

A higher level interface to Devel-Declare. This is the package you will interact with the most when using Devel::Declare::Parser.

SYNOPSIS

    package My::Keyword::Method;
    use strict;
    use warnings;

    use Devel::Declare::Parser;

    # Look at Exporter-Declare to have most of this done for you.
    sub import {
        my $class = shift;
        my $destination = caller;

        enhance( $destination, "make_method", "method" );
        no strict 'refs';
        *{ $destination . '::make_method' } = \&my_keyword;
    }

    sub make_method {
        my ( $name, $code ) = @_;
        my $dest = caller;
        no strict 'refs';
        *{ $destination . '::' . $name } = $code;
    }

    1;

API

The following functions are all exported by default. Register a parser under a short name. If $class is not provided caller will be used. Get the parser class by short name. Make $name a keyword in $dest_class that uses $parser. $parser can be a short name or class name. $type defaults to 'const'.

AUTHORS

Chad Granum [email protected]

COPYRIGHT

Copyright (C) 2010 Chad Granum

Devel-Declare-Interface is free software; Standard perl licence.

Devel-Declare-Parser is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the license for more details.