in reply to Backtick caught in infinite loop
If there is some question of what the shell is doing to your command line, you might want to try the capturex() subroutine in IPC::System::Simple. This subroutine bypasses the shell, so you don't have to worry about sanitizing metacharacters, and your command sees exactly the arguments you pass it.
IPC::System::Simple is not a core module, so you would have to install it yourself, or get a friendly system administrator (if any) to do it for you.
The recommendation above to put the arguments in an array may well have merit as a troubleshooting step, so you can print them before the command. But in your specific case the qw{...} construction is of limited usefulness because it does not interpolate. You would have to build the array with something like
. The switching between quote types in the example is a stylistic thing, since "" interpolates and '' does not, and you should do whatever your local coding standards say.my @args = ( 'command', "--arg1=$num1", '--arg2=file.log', ... "-argLa +st=$numLast" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Backtick caught in infinite loop
by tau1777 (Initiate) on Jun 21, 2014 at 18:11 UTC |