title: Accessing shell variable in a Perl program
body: <p>I have this Perl script:</p>
  <pre><code>#!/usr/bin/perl
  
  $var = `ls -l \$ddd` ;
  print $var, &quot;\n&quot;;
  </code></pre>
  <p>And ddd is a shell variable</p>
  <pre><code>$ echo &quot;$ddd&quot;
  arraytest.pl
  </code></pre>
  <p>When I execute the Perl script I get a listing of all files in the directory instead of just one file, whose file name is contained in shell variable $ddd.</p>
  <p>Whats happening here ? Note that I am escaping $ddd in backticks in the Perl script.</p>