literate⋅pl --strict --warnings --css=path/to/css filename
This script takes a literate perl file (with an lpl extension for scripts or an lpm extension for modules) and produces two files from each:
The code file is stripped of all POD and is amended based on extension and on the command line switches. The html includes
my $parser = new Pod::Literate(); GetOptions( "strict" ⇒ sub { $parser→use_strict(1) }, "warnings" ⇒ sub { $parser→use_warnings(1) }, "css=s" ⇒ sub { $parser→use_css( $_[1] ) }, "docpath" ⇒ sub { }, "srcpath" ⇒ sub { }, );
If @ARGV is empty the script assumes its input will be coming in on STDIN
$parser→parse_from_filehandle( \*STDIN ) if ( @ARGV == 0 );
Any items in ARGV are expected to be filenames
for (@ARGV) { $parser→parse_from_file($_); }
This script is a front end for Pod::Literate and uses Getopt::Long for parsing command line arguments.
use Pod::Literate; use Getopt::Long;