Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: Filehandle with DKIM::Verifier

by hippo (Bishop)
on Oct 16, 2017 at 10:23 UTC ( [id://1201432]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Filehandle with DKIM::Verifier
in thread Filehandle with DKIM::Verifier

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found