in reply to Re^2: how to pass colon and comma in exec args
in thread how to pass colon and comma in exec args

I also tried the qw with a different delimiter to avoid confusion and collision with my variables. :-)
  • Comment on Re^3: how to pass colon and comma in exec args

Replies are listed 'Best First'.
Re^4: how to pass colon and comma in exec args
by chb (Deacon) on Nov 05, 2004 at 07:03 UTC
    'man perlop' says qw{} doesn't interpolate variables.
Re^4: how to pass colon and comma in exec args
by chb (Deacon) on Nov 05, 2004 at 07:25 UTC
    If you want to avoid the shell messing up your arguments, you could try the 'indirect object'-form of exec.
    my $cmd = '/usr/bin/tcpreplay'; # or whereever exec {$cmd} ($cmd, '-p', $pps, '-i', $eth); # and so on...
    Note there is no comma after the first arg to exec. With this form exec will not use the shell and pass the list of args unchanged as argv[] to the command. This means you have to supply a value for argv[0], too (something one might forget coding too much perl...) Hope this helps....