Formatting -- recommended module
am 10.11.2006 18:41:00 von unknown
All,
I'm looking for a formatter module whose user interface looks a bit like
strftime or printf, but allows me to hook whatever back-end code I want
to the formatting. It needs to be able to produce columnar output.
Headings based on the conversion characters used would be a distinct plus.
For example, a user should be able to easily ask for right ascension
(degrees or hours, minutes and seconds) and declination - or elevation
and azimuth if he or she so chooses; preferably without me having to
calculate both ahead of time (because the user typically only wants one
or the other).
I haven't found a real good match on CPAN, but that may be because there
are so many I've missed one somehow. The closest I have come is:
* String::Format doesn't seem to have width control, and requires me to
pre-calculate everything I might want to display.
* String::FormatX requires me to pre-calculate everything and provide my
own machinery to tie it into a format string.
* Data::Display simply marshalls existing data into columns.
* Data::MaskPrint appears to handle only numeric data (I have string
data as well).
I have no doubt that Template-Toolkit would do the job, but I would like
not to put users through that learning curve.
Any thoughts?
Tom Wyant
Re: Formatting -- recommended module
am 01.12.2006 16:43:56 von unknown
harryfmudd [AT] comcast [DOT] net wrote:
> All,
>
> I'm looking for a formatter module whose user interface looks a bit like
> strftime or printf, but allows me to hook whatever back-end code I want
> to the formatting. It needs to be able to produce columnar output.
> Headings based on the conversion characters used would be a distinct plus.
>
> For example, a user should be able to easily ask for right ascension
> (degrees or hours, minutes and seconds) and declination - or elevation
> and azimuth if he or she so chooses; preferably without me having to
> calculate both ahead of time (because the user typically only wants one
> or the other).
>
> I haven't found a real good match on CPAN, but that may be because there
> are so many I've missed one somehow. The closest I have come is:
>
> * String::Format doesn't seem to have width control, and requires me to
> pre-calculate everything I might want to display.
>
> * String::FormatX requires me to pre-calculate everything and provide my
> own machinery to tie it into a format string.
>
> * Data::Display simply marshalls existing data into columns.
>
> * Data::MaskPrint appears to handle only numeric data (I have string
> data as well).
>
> I have no doubt that Template-Toolkit would do the job, but I would like
> not to put users through that learning curve.
>
> Any thoughts?
>
> Tom Wyant
Since there are no replies in three weeks, I'm proposing my own. See
thread "Proposal: String::Format::General" to be posted shortly.
Tom Wyant