G'day nifu,

Welcome to the Monastery.

Your problem description is unclear. Simply showing individual lines of code, in isolation, with no reference to their context, does not help us to help you. Please read "How do I post a question effectively?" and "SSCCE".

"I donīt know how to use the perl module with $dkim->load(*STDIN);. ..."

The documentation for Mail::DKIM::Verifier starts with an example of that (in the Synopsis); the load() section further down has details. Is some part of that unclear to you?

Reading between the lines, I suspect you may be confusing "<FILEHANDLE>" and "<>" (the special null filehandle).

I created a test file:

$ cat > XXX qwe rty

With "<>", you get the behaviour I think you're looking for:

$ perl -e 'while (<>) { print }' XXX qwe rty

With "<STDIN>", instead of "<>", the above code is waiting for input from stdin. In this example, I issued an interrupt (after waiting a few seconds for something to happen):

$ perl -e 'while (<STDIN>) { print }' XXX ^C

In the next example, I used the keyboard for stdin. Note the absence of any content from "XXX".

$ perl -e 'while (<STDIN>) { print }' XXX typed typed from from keyboard keyboard

You can get the contents of "XXX" via redirection or piping:

$ perl -e 'while (<STDIN>) { print }' < XXX qwe rty
$ cat XXX | perl -e 'while (<STDIN>) { print }' qwe rty

Take a look at "perlop: I/O Operators" and "perlvar: Variables related to filehandles" for more complete details on this subject.

— Ken


In reply to Re: Filehandle with DKIM::Verifier by kcott
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.