imperl has asked for the wisdom of the Perl Monks concerning the following question:

Hi Im trying to open a shell script and the syntax is as follows:
# ./test.sh 123.122.233.1 9879 textx.xml
This particular function need to be called repeatedly and for that I wrote a perl script using the following:
system("$test.sh");
But Im not sure, how I can mention the rest of the syntax in it? Thanks

Replies are listed 'Best First'.
Re: Opening a shell script with a particular syntax
by ghenry (Vicar) on May 25, 2005 at 08:13 UTC

    Yes, see system

    Specifically:

    @args = ("command", "arg1", "arg2"); system(@args) == 0 or die "system @args failed: $?"

    HTH.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
Re: Opening a shell script with a particular syntax
by blazar (Canon) on May 25, 2005 at 08:17 UTC
    Personally I'm not even sure what you really mean with "how I can mention the rest of the syntax in it". But maybe that's just me. All in all this is a frequently asked question and IIUC, it is in fact in perlfaq: see e.g.
    perldoc -q 'output.*system'
    Also, you may be interested in
      Thanks got the procedure after reading about the "system" command.
Re: Opening a shell script with a particular syntax
by Fang (Pilgrim) on May 25, 2005 at 07:25 UTC

    How about reading perldoc -f system ? It'll answer your question.