title: How do I output each Perl array element surrounded in quotes?
body: <p>I want to output the elements of an array in a specific format in Perl.</p>
  
  <pre><code>@myArray = ("A", "B", "C");
  $text = something;
  </code></pre>
  
  <p>Something should be the string '<code>"A" "B" "C"</code>' (each element enclosed in double quotes).</p>
  
  <p>However, if <code>@myArray</code> is empty, then <code>$text</code> should be too.
  I thought of using <code>join()</code>, such as</p>
  
  <pre><code>$text = "\"" . join("\" \"", @myArray) . "\"";
  if ($text eq "\"\"")
  {
      $text = "";
  }
  </code></pre>
  
  <p>Which I think would work. However, is there a more elegant way to do this?</p>