Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
add output filename option to script; expand README
  • Loading branch information
moritz committed Jul 25, 2011
1 parent 965b89e commit a3b3dc7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README
Expand Up @@ -7,5 +7,9 @@ The idea is to have a concise and easy-to-write source file which contains the
data, and a script that converts this information into a format that is easy
to read, like a colored HTML table or so.

A first version of that script is process.pl, which needs perl 5.10 or
newer and HTML::Template::Compiled from CPAN. It writes the xhtml output
to standard output, or to the filename specified on the command line.

Your contribution is very welcome. Please join our discussions in #perl6,
http://perl6.org/community/irc
9 changes: 8 additions & 1 deletion process.pl
Expand Up @@ -95,5 +95,12 @@ sub write_html {
}
}
$t->param(rows => \@rows);
say $t->output;
if (@ARGV) {
my $filename = shift @ARGV;
open my $out, '>:encoding(UTF-8)', $filename;
print { $out } $t->output;
close $out;
} else {
print $t->output;
}
}

0 comments on commit a3b3dc7

Please sign in to comment.