Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Running command with backslash not working as expected

by nysus (Vicar)
on May 09, 2019 at 13:00 UTC ( #1233501=note: print w/replies, xml ) Need Help??


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 (Canon) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1233501]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2019-06-17 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (76 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!