I want to start a program that requires 4 string arguments.

The program can't use 'run', I need to use 'start' with harness because I need the script to keep that task running while the script goes off to do something else. The command isn't going to stop on it's own...by design. I'll kill_kill it afterwards.

I'm having a bit of a problem getting my head around how to get the arguments passed to the command. I can't use the $in because these aren't inputs that the command is waiting for, it needs them as arguments at the moment of invocation. I am able to call the command without arguments, but when I put the arguments in with the command string, it interprets them as separate commands. Need a little help here. I have read the documentation but that focuses on programs that take input after launch, not as arguments.

http://search.cpan.org/~toddr/IPC-Run-0.94/lib/IPC/Run.pm

my @run_connector = ('/disk2/home/rlong/workdir/auto/scripts/myConnect +orScript.pl'); my @run_connectorArgs = ('log1', '10.10.101.111', 'userName', 'myPa$$W +0rD'); use IPC::Run qw( start pump finish timeout ) ; my $in = ''; my $out = ''; my $err = ''; #####NEED HELP RIGHT HERE##### my $harness = start \@run_connector, \$in, \$out, \$err, timeout( 6 +00 ) or die "run_connector: $?\n"; print "\nSleeping 30 Seconds\n"; sleep 30; $harness->kill_kill; $?\n"; print "\nFinished run_connector\n"; print "Here is the Out:\n"; print "$out\n"; print "Here is the Error:\n"; print "$err\n";

In reply to Passing Arguments for IPC::Run start() by archeman2

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.