in reply to Running command with backslash not working as expected

In your first example the \r is enclosed in back-quotes which interpolate the same as a double quoted string, so \r gets translated to the carriage return character.

In the second example the \r is enclosed in single quotes which do not interpolate so it contains the two characters \ and r.

You need to enclose the string in double quotes:

my $value = qq[ -c "normal \r" -c wq ~/vimwiki/testing.md];

Replies are listed 'Best First'.
Re^2: Running command with backslash not working as expected
by nysus (Parson) on May 09, 2019 at 12:55 UTC

    I originally had qq() (forgot to mention it) and it didn't work. It works now. There must have been another bug masking it. I was up way too late last night. Thanks.

    $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

Re^2: Running command with backslash not working as expected
by nysus (Parson) on May 09, 2019 at 14:04 UTC

    Ah, dammit. In some code that is not shown, I introduce the `\r' in singe quotes. Myopia.

    $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