go ahead... be a heretic | |
PerlMonks |
Re: Filehandle with DKIM::Verifierby kcott (Archbishop) |
on Oct 15, 2017 at 01:57 UTC ( [id://1201386]=note: print w/replies, xml ) | Need Help?? |
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:
With "<>", you get the behaviour I think you're looking for:
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):
In the next example, I used the keyboard for stdin. Note the absence of any content from "XXX".
You can get the contents of "XXX" via redirection or piping:
Take a look at "perlop: I/O Operators" and "perlvar: Variables related to filehandles" for more complete details on this subject. — Ken
In Section
Seekers of Perl Wisdom
|
|