#!/usr/bin/perl use strict; use warnings; #@ @node A few good subs #@ @chapter A few good subs #@ #@ This is a line of POTD. This module contains #@ some functions and might be used as follows: #@ @verbatim #@ do_something(); # Magic happens here! #@ @end verbatim #@ # ------------------ # Subroutines # ------------------ #@ @node do_something #@ @section do_something #@ #@ You'd use this @emph{awesome} function for: #@ #@ @itemize #@ @item #@ When you want to do foo. #@ #@ @item #@ When you want to do bar, since foo obviously #@ isn't cutting it. #@ @end itemize sub do_something { print "Magic goes here.\n"; } print "hi.\n"; do_something; print "bye!\n"; #### #!/usr/bin/perl use warnings; use strict; my @lines = (); while ( <> ) { if (/^#@/) { s/^#@[ \t]*//; push @lines, $_; } } my $lines = join '', @lines; # Now pipe $lines through any one of: # - texi2dvi # - texi2pdf # - makeinfo