Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Filehandle with DKIM::Verifier

by kcott (Archbishop)
on Oct 15, 2017 at 01:57 UTC ( [id://1201386]=note: print w/replies, xml ) Need Help??


in reply to Filehandle with DKIM::Verifier

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-28 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found