in reply to Re: Running command with backslash not working as expected
in thread Running command with backslash not working as expected

Thanks. system results in a lot of unwanted ugliness to the screen. Besides, system returns a response code which I'm just going to throw away. Plus backticks are faster to type and less cluttering.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^3: Running command with backslash not working as expected
by haukex (Archbishop) on May 09, 2019 at 13:35 UTC
    system results in a lot of unwanted ugliness to the screen.

    There are ways to work around that. Many commands support a --quiet switch, which is my preferred method because I usually want to see external command's output to be able to inspect it for problems, or you could use another module to capture the command's STDOUT to suppress it.

    system returns a response code which I'm just going to throw away.

    I don't understand this argument - you're throwing away the backtick's return value as well... Plus, why would you call a command and then ignore whether it was successful or not?

    backticks are faster to type and less cluttering.

    Backticks don't offer a way to avoid the shell.

      I'm launching vim with the commands. I already have tests to see if vim is installed and executes properly. I only care about whether the manipulations of file vim operates upon work.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks