# perl -MText::Autoformat -e 'print $Text::Autoformat::VERSION , "\n"' ; cat p.pl ; echo ; perl p.pl
1.67
####
#!/usr/local/bin/perl
use warnings; use strict;
use Text::Autoformat qw[ autoformat ];
my $in = do { local $/; };
my $opts = { 'lists '=> 'number' , 'renumber' => 1 };
printf "# PRE\n%s\n# POST: text , option\n%s\n# POST: option, text\n%s\n"
, $in
, autoformat( $in , $opts )
, autoformat( $opts , $in )
;
__DATA__
1. Analyze problem
3. Design algorithm
1. Code solution
# PRE
1. Analyze problem
3. Design algorithm
1. Code solution
# POST: text , option
1. Analyze problem
3. Design algorithm
1. Code solution
# POST: option, text
1. Analyze problem
3. Design algorithm
1. Code solution
##
##
# Configuration...
$formatted = autoformat $rawtext, { %options };
##
##
# Don't recognize Roman numerals or alphabetics as list markers...
autoformat { lists => 'number, bullet' }, $text;