report generation with format/write

[email protected] (Nathan Torkington)
Newsgroups perl.trainers
Message-ID <[email protected]>
[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.

I don't teach format+write, because of the unpleasant need for every
variable you use in a format to be in scope when the format is
declared.  I'd like to separate them, but can't.

My solution is templates.  When someone asks me about report
generation, I always tell them about printf, Text::Template, the
various HTML/CGI/mod_perl doodads, and then mention formats only to
say why I don't like them.

Nat
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.