Steven Haryanto > Pod-Weaver-Plugin-Eval > Pod::Weaver::Plugin::Eval

Download:
Pod-Weaver-Plugin-Eval-0.02.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Pod::Weaver::Plugin::Eval - Evaluate code

VERSION ^

version 0.02

SYNOPSIS ^

In your weaver.ini:

 [-Eval]
 include_modules = ^Foo::Bar$
 ;include_files  = REGEX
 code = sub { my ($self, %args)=@_; use Module::Load; load $args{module}; my $document = $args{document}; push @{$document->children}, ... }

DESCRIPTION ^

This plugin evaluates Perl code specified in your weaver.ini (or dist.ini). It can be used to do various stuffs that might be too trivial/short to build a dedicated Pod::Weaver::Plugin for.

I first created this module to insert list of border styles and color themes contained in %border_styles package variable in Text::ANSITable::BorderStyle::* modules and %color_themes variable in Text::ANSITable::ColorTheme::* modules.

Yes, it's a dirty (and ugly) hack. But it's quick :-)

CONFIGURATION ^

include_files => STR

Value should be a regex, e.g. /Foo/Bar/.

include_modules => REGEX

Value should be a regex, e.g. ^Foo::Bar$.

code => STR

Should be something like:

 sub { my ($self, %args) = @_; ... }

sub { and } will be added if code does not have it. Code will be called with %args containing these keys:

SEE ALSO ^

Pod::Weaver

AUTHOR ^

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Steven Haryanto.

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

syntax highlighting: