Greetings, Monks!

Long have I assimilated knowledge from you, unseen. I emerge from the shadows of Lurkwood to place this query before you:

How do I provide command-line arguments to a command-line Perl call (from a tcsh script, no less)?

The purpose of this operation is to replace this line in ConfigFile:

'def' => '',

With this:

'def' => 'dumper/$tcsh_input',

(Where $tcsh_input is actually a command-line argument to the tcsh script)

Here is what I am attempting now in my tcsh script:

perl -pi -e '$design = $ARGV[0] ; s/.*'def'.*''/\t"def" => "dumper\/$design.def",/g' ConfigFile $tcsh_input

Any arguments after the -e switch, however, seem to be treated as input files, so I see this:

>> perl -pi -e '$design = $ARGV[0] ; s/.*'def'.*''/\t"def" => "dumper +\/$design.def",/g' ConfigFile ADCIF Can't open ADCIF: No such file or directory, <> line 194.

Is there a separate switch I can use before -e to represent the arguments (accessible through @ARGV) to the program?

Kindly bless me with your wisdom, so that I may express my gratitude and scurry back into the shadows from whence I came; all this light is hurting my eyes.

~Recursion


In reply to Command-line arguments to command-line Perl by RecursionBane

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.