Re: report generation with format/write

[email protected] (William R Ward)
Newsgroups perl.trainers
Message-ID <[email protected]>
Larry Wall <[email protected]> writes:
> [email protected] writes:
> : Does anyone actually teach report generation with format/write?  I
> : haven't really seen anyone using it much in the last few years, but I've
> : just had a corporate client ask us to teach "reports" in Perl.
> : 
> : It's not part of our standard introductory Perl course, and to be honest
> : I'm dreading having to write it ... ick ick ick.
> 
> Unless line printers come back into vogue, I wouldn't put a lot of
> stress on it.  These days, most reports are printed on browser screens.
> 
> The fact is, the whole fixed-width character culture is in serious
> trouble with the advent of Unicode.  Even xterm is having to come to
> terms with double-wide characters these days.  We'll probably have to
> do something similar with format/write.  (What we probably ought to do
> is redo the report writer to spit out XML tables or some such. :-)/2
> 
> On the other hand, maybe fixed-width characters will be viewed as retro
> and cool in 5 years.  You never know, you know...

A client I was working for last year needed some help with their
reporting tools - it seems that the HTML table-based reports were not
very popular and they wanted fixed-width type reports.

So I wrote something using formline (because the table column widths
were dependent on which columns were in that particular report) that
did the same thing.  Then I did some obscene voodoo with s/// to add
HTML links to some of the numbers for drill-down.  The whole thing was
thrown between <PRE> and </PRE> tags.

It was extremely well received.

I teach format and write in my classes, and I always explain that it's
most commonly used nowadays for reports that go out in e-mail
messages.  I don't teach formline though.

--Bill.

-- 
William R Ward        [email protected]      http://www.bayview.com/~hermit/
-----------------------------------------------------------------------------
The secret of being creative is making something that's not very new
but just a little bit different in the right direction - Marvin Minsky
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.