Lisp::Fmt is a Perl module for Common Lisp like formatting.
SYNOPSIS
use Lisp::Fmt;
$str = fmt("~{~a ~5,,,'*a~}", $a,$b,$c,$d); # store result in $str
pfmt("~{ ~a~5,,,'*a~}", $a,$b,$c,$d); # print to stdout
The Common Lisp "format" function provides an extremely rich set of formatting directives. This module brings this to Perl.
The formatting directives all begin with a ~ and take the form: ~[N]{,N}[@][:]X
where N is a number, X is a formatting directive, and @ and : are optional modifiers. Recognized directives are: A, S, W, D, O, B, X, R, C, P, T, ~, %, |, _, ?, *, n, {, }, (, ), [, ], , ^
examples:
C - simplest format spec, prints the arg
C - prints a number in base 10
C - prints a number in base 16
C - prints a number in base 12
C - prints a number in roman numerals
C
Product's homepage
Requirements:
· Perl