I hope this post finds you doing well. I'm having problems passing CLI arguments from one *.pl to another. Here's what my code looks like so far: Script one that calls script two:
#!/bin/perl use CGI; $query = new CGI; @keywords = $query->keywords; $timeframe = &trim(uc(@keywords[0])); $sp_action = &trim(uc(@keywords[1])); use LWP::Simple; $rundir = '/opt/oracle/CSMDB/LoadFiles'; $exe_dir = $rundir . "/Monthly/current_load"; $actual_cmd = "files_present.pl"; system($exe_dir . "/" .$actual_cmd . " " . $exe_dir . " " . $sp_action + ); Second *.pl script called by script above: #!/bin/perl use CGI; $query = new CGI; @keywords = $query->keywords; $exe_dir = @keywords[0]; $time_frame = @keywords[1];
Incidentally, I call script one by typing ..... ./loader.pl monthly RUN_CAP_LOAD and it successfully receives the CLI parameters I send it. When the execution gets to the second script I get a hang and a message saying ... "(offline mode: enter name=value pairs on standard input)" and the script(s) hang. Why is the second script NOT picking up the parameters it gets passed from the system line in the first script. Thanks in advance for your help.

Retitled by holli from 'I'm sure this is really simple ... just not for me'.


In reply to passing arguments between scripts by jeastman

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.