in reply to Templating pod generation?
No, that won’t work. Generally, you have to generate your POD statically, else it won’t be understood by POD processors. So why not document them all once, instead of repetitively documenting each with the same boilerplate?
=head2 io( OBJ ) =head2 fm( OBJ ) =head2 cv( OBJ ) =head2 hv( OBJ ) =head2 pvlv( OBJ ) =head2 gv( OBJ ) =head2 av( OBJ ) =head2 bm( OBJ ) =head2 pvmg( OBJ ) =head2 pvnv( OBJ ) =head2 pviv( OBJ ) =head2 rv( OBJ ) =head2 nv( OBJ ) =head2 iv( OBJ ) =head2 pv( OBJ ) =head2 sv( OBJ ) Returns a boolean indicating whether OBJ is an instance of the B:: cla +ss indicated by the method name, and respects any overridden C<-E<gt> +isa> methods.
Granted, that’s not entirely DRY. For that, you could try turning your question on its head by parsing your own POD at load time in order to get the list of functions to generate. (I also enjoy Pod::Constants, but it doesn’t fit your use case.)
PS.: your use of eval is unnecessary:
for my $nm ( qw( io fm cv hv pvlv gv av bm pvmg pvnv pviv rv nv iv pv +sv ) ) { my $nm_pkg = "B::$nm"; *{ $nm } = sub { my $op = shift @_; return blessed( $op ) and $op->isa( $nm_pkg ); } }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Templating pod generation?
by diotalevi (Canon) on Jul 19, 2006 at 06:16 UTC | |
by Aristotle (Chancellor) on Jul 19, 2006 at 06:27 UTC | |
by diotalevi (Canon) on Jul 19, 2006 at 15:54 UTC | |
by chromatic (Archbishop) on Jul 19, 2006 at 21:22 UTC | |
by Aristotle (Chancellor) on Jul 19, 2006 at 17:11 UTC | |
by diotalevi (Canon) on Jul 19, 2006 at 19:32 UTC |