LanX has asked for the wisdom of the Perl Monks concerning the following question:
I had a discussion with Ilya Zakharevich about how cperl-mode in emacs should fold perl-code in respect to embedded POD.
I'm a big fan of literal programming, DRY and encapsulation but holding the documentation in close vicinity to the code doesn't seem to be that easy in perl...
Do I get right that the only "straighforward" way to achieve this with CPAN-like POD-structure is by splitting POD into two surrounding parts and preceding every sub by
parts?=head2 ... =cut
=head1 NAME =head1 VERSION =head1 SYNOPSIS =head1 DESCRIPTION =cut # some nonsub perlcode #======================================== =head1 METHODS intro about methods ... =cut #---------------------------------------- =head2 load ($source, -opt1 => $val1, ...) text describing load() =cut sub load { #body #body #body } #---------------------------------------- =head2 parse ($string, -opt1 => $val1, ...) text describing parse() =cut sub parse { #body #body #body } #======================================== =head1 SEE ALSO =head1 AUTHOR =head1 BUGS =head1 ACKNOWLEDGEMENTS =head1 COPYRIGHT & LICENSE =cut
NAME
VERSION
SYNOPSIS
DESCRIPTION
METHODS
intro about methods ...
load ($source, -opt1 => $val1, ...)
text describing load()
parse ($string, -opt1 => $val1, ...)
text describing parse()
SEE ALSO
AUTHOR
BUGS
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Cheers Rolf
|
|---|