Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Template::Toolkit and Text::Table

by Marshall (Canon)
on Feb 06, 2020 at 10:11 UTC ( #11112484=note: print w/replies, xml ) Need Help??


in reply to Template::Toolkit and Text::Table

Perl has a built in formatter..see https://perldoc.perl.org/perlform.html

I think you will find that it is more hassle than it is worth. I find that printf works a lot better.

I also think that you will find that an email with the assumption that the user is using a fixed width font won't work well. Even if your email looks nice as you send it, the user's email program probably won't display it like you intended.

Sounds like some kind of HTML doc will work better. Or perhaps a .pdf file?

Replies are listed 'Best First'.
Re^2: Template::Toolkit and Text::Table
by Skeeve (Parson) on Feb 06, 2020 at 11:39 UTC
    Perl has a built in formatter..see https://perldoc.perl.org/perlform.html

    But for this I would need to know the data upfront. I want the table to be built according to the data. In spite of my examle the data of course, comes from a database and the column widths haveto adjust. That's what Text::Table does.

    I also think that you will find that an email with the assumption that the user is using a fixed width font won't work well.

    I know. An HTML alternative is sent as well.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      Another option to consider is a .CSV file. Text::CSV is one possibility. Just a thought. Spreadsheet programs are pretty ubiquitous nowadays.A long, long time ago I had to produce a weekly report. I wound up making an Excel spreadsheet with some macros which I gave my users. Then the weekly report was a simple .CSV file (plain text) that they imported into my predeployed "smart sheet" (binary).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11112484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2020-11-28 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?