Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Got an error like this:
Unknown error at C:\811150.pl line 18
use Socket qw( AF_INET SOCK_STREAM PF_UNSPEC ); use IPC::Open3 qw( open3 ); sub _pipe { socketpair($_[0], $_[1], AF_INET, SOCK_STREAM, PF_UNSPEC) or return undef; shutdown($_[0], 1); # No more writing for reader shutdown($_[1], 0); # No more reading for writer return 1; } sub _open3 { local (*TO_CHLD_R, *TO_CHLD_W); local (*FR_CHLD_R, *FR_CHLD_W); local (*FR_CHLD_ERR_R, *FR_CHLD_ERR_W); if ($^O =~ /Win32/) { _pipe(*TO_CHLD_R, *TO_CHLD_W ) or die $!; _pipe(*FR_CHLD_R, *FR_CHLD_W ) or die $!; _pipe(*FR_CHLD_ERR_R, *FR_CHLD_ERR_W) or die $!; } else { pipe(*TO_CHLD_R, *TO_CHLD_W ) or die $!; pipe(*FR_CHLD_R, *FR_CHLD_W ) or die $!; pipe(*FR_CHLD_ERR_R, *FR_CHLD_ERR_W) or die $!; } my $pid = open3('>&TO_CHLD_R', '<&FR_CHLD_W', '<&FR_CHLD_ERR_W', @ +_); return ( $pid, *TO_CHLD_W, *FR_CHLD_R, *FR_CHLD_ERR_R ); } my $log="TestOpen3.log"; open FHO, ">$log"; select FHO; my ($pid, $to_chld, $fr_chld, $fr_chld_err) = _open3("cmd /c dir * \/b +\/s"); if((my $returnCode = $? >> 8) !=0){ print "[ERROR] ($returnCode) : "; while(<$fr_chld_err>) { print; } close $fr_chld_err; die $returnCode; } while(<$fr_chld>) { print "\t".$_; } close $fr_chld; close FHO;

In reply to Re^3: why IPC::Open3 can't execute MS-DOS "dir" command? by Anonymous Monk
in thread why IPC::Open3 can't execute MS-DOS "dir" command? by kiinoo

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 contemplating the Monastery: (9)
    As of 2014-07-24 08:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (158 votes), past polls