This is the code from my "email parse script"

So that section is not relevant to your test script. If we omit it we can end up with a working version such as:

use strict; use warnings; use Test::More; use Mail::DKIM::Verifier; my @good = qw/good1.txt good2.txt/; my @bad = qw/bad1.txt bad2.txt/; plan tests => @good + @bad; for my $goodfile (@good) { my $dkim = Mail::DKIM::Verifier->new(); open (my $gfh, '<', $goodfile) or die "Error opening $goodfile: $! +"; $dkim->load ($gfh); is ($dkim->result_detail, 'pass', $goodfile); close $gfh; } for my $badfile (@bad) { my $dkim = Mail::DKIM::Verifier->new(); open (my $bfh, '<', $badfile) or die "Error opening $badfile: $!"; $dkim->load ($bfh); isnt ($dkim->result, 'pass', $badfile); close $bfh; }

Obviously you can change the filenames in the @good and @bad arrays until you have what you want. This script works fine for me testing on good and bad data.


In reply to Re^5: Filehandle with DKIM::Verifier by hippo
in thread Filehandle with DKIM::Verifier by nifu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.