Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't understand if you're trying to use those programs or to recreate similar ones.

The attempt was a little of both, but I should have specified that I was trying to provide an sshclient-like interface for a qmail filtering program, since (as you mentioned) running a Perl program as sshclient's child is pretty easy.

I'd used sshclient in the past, and even though I often mix up which fd is read and which is write does what (different djb/djb-like util's use different fd's for different things), I like the nice, generic, cross-language interface. It fits nicely with both "Do one thing, and do it well" and "Everything's a pipe". I wondered how easy it'd be to provide that interface in Perl.

The idea was that I would provide the filtering program (child) fd's 0,1,4,5,6,7 for message-in, message-out, header-in, header-out, body-in, and body-out. If any of the '-out's was the same as its '-in' or was empty, the original would be used. And, either message-out or (header-out + body-out) would be used, depending on what the filter program changed.

Since this isn't easy to do, I'm probably going to use an option flag to specify which one of 'message', 'headers', or 'body' the filter wants to have and just use STDIN + STDOUT.

Thanks

Update: clarified my confusion re: djb{|-esque} tools' use of fd's


In reply to Re: Open a file on a specific file descriptor? by benizi
in thread Open a file on a specific file descriptor? by benizi

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-19 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found