in reply to Passing Command line values from Perl to Sh via system()

Try
system("$testprog $a $b '$c'");
Instead, this gives
1 = 1 2 = 2 "This is a test" = This is a test
Is this what you meant?

Replies are listed 'Best First'.
Re: Re: Passing Command line values from Perl to Sh via system()
by P0w3rK!d (Pilgrim) on Jul 17, 2001 at 20:02 UTC
    What can I do in this case?
    #...call to function &SomeFunction($a, $b, $c); #...in the function @args = ("$program $a $b $c"); system(@args) == 0 or die "system @args failed: $?";
    ...Do I change it to this?
    #...call to function &SomeFunction($a, $b, '$c'); #...in the function @args = ("$program $a $b '$c'"); system(@args) == 0 or die "system @args failed: $?";
    ?