in reply to Replacing backticks with system() and redirecting STDERR to file

You can eliminate a lot of the backslashing by using alternative delimiters:
my $command = 'ssh ' . $node . q[ "perl -lne'm!(.*)/! && qx[su xxx -c +\"mkdir -p \$1\" && su xxx -c \"touch \$_\"]'] . qq[ 1>> $storageRoot +Path_log 2>> $storageRootPath_err"];
  • Comment on Re: Replacing backticks with system() and redirecting STDERR to file
  • Download Code