in reply to how to escape round parentheses in a system call

It's not clear how the command fails. I replaced "command" with "echo" and added a simple string to the hash referenced by $_. The qq behaves as double quotes, i.e. a single backslash is interpreted by it, so \( becomes (, but ( is special in the shell. You need to escape it, so use double backslash:
$_->{Sub_URL} = 'suburl'; print qq{echo $_->{Sub_URL} \(?i\)Podcast ARGS\n}; system qq{echo $_->{Sub_URL} \\(?i\\)Podcast ARGS}; # ~~ ~~
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: how to escape round parentheses in a system call
by ObiPanda (Acolyte) on Jun 11, 2023 at 21:35 UTC

    thanks. It works exactly as needed.

      It may work, but I disagree that it is a good solution: it will blow up when $_->{Sub_URL} contains shell metacharacters, and is a security hole if that variable contains any user input.

      See Calling External Commands More Safely. In this case I would recommend systemx from IPC::System::Simple, or at the very least the multi-argument system (as shown in other replies) with error checking (nobody showed this, but for an example see the first link).

      sigh