title: How to split a string containing a hyphen in perl
body: <p>I have a string referred to as ($date) that I am trying to split into two parts using Perl. </p>
  
  <pre><code>$date= (June 25, 2018–July 1, 2018)
  </code></pre>
  
  <p>From what I have read it seems that the proper way to split this string into the two separate dates would be to create a new array, use the Perl split() function with the hyphen as a delimiter and then assign the array index values to my StartDate/EndDate variables like this...</p>
  
  <pre><code>@dates = split(/-/, $date);
    $StartDate = @dates[0];
    $EndDate = @dates[1];
  
  print "Effective Date: ($date)\n";
  print "($StartDate)";
  print "\n";
  print "($EndDate)";
  </code></pre>
  
  <p>However this does not work as I expected it to. </p>
  
  <p>Please keep in mind that the code above is only a small section of the source code. </p>
  
  <pre><code>Current Output (Incorrect)
  
  Effective Date: (June 25, 2018–July 1, 2018)
  (June 25, 2018–July 1, 2018)
  ()
  </code></pre>
  
  <p>Expected Output (Correct)</p>
  
  <pre><code>Effective Date: (June 25, 2018–July 1, 2018)
  (June 25, 2018)
  (July 1, 2018)
  </code></pre>
  
  <p>Looking for any advice on how to achieve my goal.</p>