in reply to Re^2: Running Entire Bash Script Inside Perl
in thread Running Entire Bash Script Inside Perl

That design requires advance knowledge of the script (to change $1 to the parameter).

Well, there's no telling from the OP (as originally seen) how much is known in advance. Whatever the requirements are for the task, this approach could be adapted to use the available knowledge as needed, and work as well as other approaches.

The implementation fails if $param contains two spaces in a row, a quote, etc.

Sure. When printing commands to a shell process, there are lots of ways to go wrong and fail (and/or cause all sorts of mayhem and damage, depending on what sorts of mistakes are made and how various permissions play out when the perl script executes). This approach demands respect and caution; anyone who isn't sure whether they might get it wrong probably shouldn't use it.

  • Comment on Re^3: Running Entire Bash Script Inside Perl