Thanks. That has advanced the ball but I am not at the goal line yet. You cleared up my confusion with respect to arguments and redirection but now I need to better understand how things work. Here is my current code segment:
. . . my @cmd=("/bin/cpio","-ov"); my $h=start(\@cmd,">",$tape,\$in,\$out,\$err); $thisline=readline(FILELIST); while (defined $thisline) { ($thisfile,$thisfilesize)=split(/\t/,$thisline +); $in="$thisfile\n"; print("Dumping $in"); $h->pump || die putmsg("Dieing - $err"); if (length($out)>0) { putmsg($out); } $total+=$thisfilesize; $complete=sprintf("%.2f",($total/$dumpsize)*10 +0); putmsg("$complete%\n"); $thisline=readline(FILELIST); } finish $h; . . .
The script now blocks forever on the 'pump' function. At the same time the harness is always pumpable so if I use 'pump_nb' and test 'pumpable' it goes into an unending loop. Finally, even the first 'pump' execution does not cause 'cpio' to do anything. At this point I don't know if it is 'cpio' that I need to understand better or IPC::Run. Any ideas? The objective is to go through a list of files/directories provided by 'FILELIST' and have 'cpio' write them to tape. After each file dump, output the file/directory name and calculate the percent complete from the file size which was also provided by 'FILELIST'. That means expecting 'cpio' to read a file from STDIN and write the filename to STDOUT when it dumps it. That appears to be the way it works from command line except the entire input must be provided at once. What I expect IPC:Run to do, if I understand it, is to essentially make 'cpio' interactive, programmatically.

In reply to Re^2: Using IPC::Run by gw1500se
in thread Using IPC::Run by gw1500se

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.