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

my @args = ( 'command', "--arg1=$num1", '--arg2=file.log', ... "-argLa +st=$numLast" );
. 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.

Replies are listed 'Best First'.
Re^2: Backtick caught in infinite loop
by tau1777 (Initiate) on Jun 21, 2014 at 18:11 UTC

    Thank you, this will come in handy in the future for my personal perl usage.

    Unfortunately, I'm using a cluster where I don't have the ability to install modules. And if its not a core module the admins probably won't do it either.

    Furthermore, the suite of perl scripts we were using recently broke down becuase of mismangement/misunderstanding of the modules currently installed, so installing more modules is a road I really don't want to go down, right now.