Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
That seems like a perl limitation, not a unix one, since there are plenty of ways to do this in perl and without.

For whatever reason, you have to use fork or modules (like IPC::Open3 or whatever) in unix. Actually, why does system(1,$cmd) work at all? I don't see that documented. It's possible I'm blind. I'm cutting down on coffee.

UPDATE: I still don't see how that's a unix problem, rather than a perl one; but I guess I understand your animosity/reciprocity.

UPDATE2 (nov 1st): Your example (in a sibling post) also seems intentionally complex...

use strict; use warnings; use IPC::Open3; use Data::Dumper; my ($w,$r,$e, @pids); push @pids, open3($w,$r,$e, qw(ls -al)); push @pids, open3($w,$r,$e, qw(ls -al)); push @pids, open3($w,$r,$e, qw(borked mang)); # tye commented privately that I seem to misunderstand open3, so I jus +t thought # I'd mention that I'm perfectly aware I'm screwing up the file handle +s both by # reusing them and failing to close them. This is just an example... + Perhaps it's # because the ls doesn't print to stdout? I suppose that isn't the sa +me as system(). # *shrug* my @ret = map {[waitpid($_,0) => $?]} @pids; print "", Dumper(\@ret), "\n";

-Paul


In reply to Re^2: Perl wait vs Unix ksh wait (spawn) by jettero
in thread Perl wait vs Unix ksh wait by mifflin

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (15)
    As of 2014-10-24 13:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (132 votes), past polls