jumpingmonkey has asked for the wisdom of the Perl Monks concerning the following question:

Hi I am a novice in HTML.

I am comparing 2 files using hashes and printing out differences.

When I try to print and mail the output becomes all garbled in outlook.

What approach should I take here? How to I print a nice output table with the data and email it so it is easy on the eyes. I saw a peer use HTML.

I have these modules available: sSubs.pm Element Element.pm Form.pm FormatPS.pm FormatRTF.pm FormatText.pm Formatter.pm Mason Mason.pm Parse.pm Scrubber.pm Tagset.pm Template.pm Tree Tree.pm TreeBuilder.pm CGI.pm, Under CGI I have following. Apache.pm Carp.pm Cookie.pm Fast.pm Pretty.pm Push.pm Switch.pm Util.pm

Again I am a novice in HTML. What direction should I take from here?

Actually I added some code using HTML Template:

my $template = HTML::Template->new( filename => 'temp.tmpl' ); @languages =(); foreach (sort keys %fm) { if ((! $fm{$_}{'cksum'}) && (! $fm{$_}{'byte'})) { @minilanguage=(); @minilanguages = ( { fmfile_name => $_ , fmfileowner => $fm{$_}{'owner'} }, ); push @language, @minilanguages; delete $fm{$_}; } } print "@languages\n"; $template->param( FMPermissionIssue => @languages ); print $template->output();
Obviously this is not 100% correct but My hashes could be any size, they dont have fixed info. Suggestions to make this correct?

Replies are listed 'Best First'.
Re: Print output as a HTML table and email
by wazat (Monk) on Dec 08, 2014 at 04:52 UTC

    Please don't take this the wrong way but your post is difficult to look at.

    Use <p></p> and <code></code> tags to mark up your question.

    Preview before creating.

      Also , updates should be marked as such How do I change/delete my post?

      The update seems to work out to the following question

      Suggestions to make this correct?
      my $template = HTML::Template->new( filename => 'temp.tmpl' ); @languages =(); foreach (sort keys %fm) { if ((! $fm{$_}{'cksum'}) && (! $fm{$_}{'byte'})) { @minilanguage=(); @minilanguages = ( { fmfile_name => $_ , fmfileowner => $fm{$_}{'owner'} }, ); push @language, @minilanguages; delete $fm{$_}; } } print "@languages\n"; $template->param( FMPermissionIssue => @languages ); print $template->output();

      That is at least a starting point for an actual question ( How do I post a question effectively? ) but IMHO op needs to clean your room better :) still many parts missing if fixing the original is any kind of goal and SYNOPSIS of alternatives aren't enough

Re: Print output as a HTML table and email
by Anonymous Monk on Dec 07, 2014 at 23:52 UTC

    When I try to print and mail the output becomes all garbled in outlook.

    You don't say :)

    What direction should I take from here?

    Up

    html email

Re: Print output as a HTML table and email
by Corion (Patriarch) on Dec 08, 2014 at 13:21 UTC

    You might want to take a look at Email::MIME::Kit, which takes a directory-based approach to constructing MIME mails. Using that approach, you could collect all the assets that make up a mail in a directory and change these assets.

    On the other hand, now that I look at your source code, you seem to have more questions about how to use HTML::Template or maybe Template::Toolkit.

    Maybe you can tell us what exact program you have, and where it does not do the things you want it to do. Please try to turn your program into a self-contained minimal example.

Re: Print output as a HTML table and email
by Anonymous Monk on Dec 08, 2014 at 13:15 UTC
    Use a template (e.g. Template to create the HTML-string given the content, then use any Mail-sending package to send it. But first, see if there does not already exist (it does ...) a bulk-mail program that can do the job completely and without any fuss.
      see if there does not already exist (it does ...) a bulk-mail program

      So if you're claiming a program to solve the OP's question exists, why not link to it?

        see if there does not already exist (it does ...) a bulk-mail program So if you're claiming a program to solve the OP's question exists, why not link to it?

        Eh? bulk mail -> bulkmail?