http://www.perlmonks.org?node_id=1233483

nysus has asked for the wisdom of the Perl Monks concerning the following question:

So running this command gives the desire result in the output file:

$_vim_cmd = '/usr/local/bin/vim'; `$_vim_cmd . ' -c "normal \r" -c wq ~/vimwiki/testing.md'`;

This, however, does not:

$_vim_cmd = '/usr/local/bin/vim'; my $value = ' -c "normal \r" -c wq ~/vimwiki/testing.md'; `$_vim_cmd $value`;

The \r is not getting processed. I tried escaping it: \\r and I tried \Q and I tried qx() but nothing does the trick.

This also works but is far from ideal, obviously:

my $c1 = ' -c "normal '; my $c3 = '" -c wq ~/vimwiki/testing.md'; `$_vim_cmd $c1\r$c3`;

$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