With warnings enabled, Perl will complain if you try to interpolate an uninitialized or undefined variable, and if there has never been a regex capture to capture group 9, that's what the special variable  $9 will be. See Variables related to regular expressions in perlvar for discussion of  $1 $2 $3 $n   etc.

So one wrong you have done is to ignore the warnings you asked Perl to give you.

>perl -wMstrict -le "my $sw = '/b'; my $d = `dir $sw $9`; print qq{'$d'}; " Use of uninitialized value $9 in concatenation (.) or string at -e lin +e 1. 'arb_nested_HoH_1.pl arb_struct_access_1.pl arb_struct_access_2.pl ... most_of_8_1.pl recurring_cycle.pl recurring_cycle.pl.bak '

In reply to Re: using Backtick inside perl gives different output by AnomalousMonk
in thread using Backtick inside perl gives different output by kaka_2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.