#!/usr/bin/perl -w
use strict;
use HTML::Template;
my $output_template = qq*
Function Name: | Description |
| |
*;
my @output = do{
local @_;
#you will need to replace the DATA handle with
#one to your file of interest.
my $string = do{
local undef $/;
};
while($string =~ /\s?STANDARD\s+(.*?)\nfunction\s(\S+)\n?/mg){
push @_, {name=>$2, desc=>$1};
}
@_;
};
my $tmplt = HTML::Template->new(scalarref=>\$output_template,die_on_bad_params=>0);
$tmplt->param({functions=>\@output});
print $tmplt->output();
exit;
__DATA__
blah
blah
blahblah blah
blah
blah
blah
blahblah blah
blah
# STANDARD This is some text that describes
function seventhdoesnotgetenoughsleep
# STANDARD This is some describing text
function seventhgetsomesleep
blah
blah
blahblah blah
blah
# STANDARD This is some description
function seventhgethomesafe
blah
blah
blahblah blah
blah
# STANDARD This is some text ...nuff said
function seventhwhyiraq
blah
blah
blahblah blah
blah