ABOUT This module aims to provide an easy interface to Devel::Declare. EXAMPLES SQL.pm - execute select statements in perl Methods.pm - usual method signature PLAN * add support for multiple keywords per module * remove globals * write pod for Keyword::Declare * cleanup parser construction (check if code exists etc) * write default action to return whatever the parse routine matched * add pre and post block hooks with shadow { setup_stuff() ;exec_block(); do_stuff; return $ret} * alter sig syntax to (see MXD code) keyword method (Maybe[Ident] $ident, Maybe[Proto] $proto, Block $block) { RESEARCH * find usescases from: http://cpants.perl.org/dist/used_by/Devel-Declare * and go through perl's -existing- keywords print $fh "sddfsd". $f, $c etc * look at ... metalua ... and common lisp reader macros. * long term goal, a hints file describing syntax to be shared with ppi / vim etc CURRENT SYNTAX # parse an action routines called for each entry in proto keyword method (ident?, proto?, custom, block) { $block->name($ident); # name the block $block->inject_begin($proto); # inject at begin of block $block->inject_after("warn '$ident() finished';"); $block->terminate; # add semi colon } parse custom ($parser) { if (my $len = $parser->scan_word(1)) { my $l = $parser->line; my $ident = substr($l, $parser->offset, $len); substr($l, $parser->offset, $len) = ''; $parser->line($l); return $ident if $ident =~ /^[a-z]{1}\w+$/i; } else { die "unable to match blah"; } } # passed whatever the parse routine matches action proto ($match) { my $match; return $code; }