title: escape special character in perl when splitting a string
body: <p>i have a file in this format</p>
  
  <pre><code>string: string1
  string: string2
  string: string3
  </code></pre>
  
  <p>i want to split the lines by <code>space</code> and <code>:</code>,so initially i wrote this:</p>
  
  <pre><code>my @array = split(/[:\s]/,$lineOfFile);
  </code></pre>
  
  <p>the result wasn't as expected, because inside <code>@array</code> the <code>split</code> inserts also <code>white space</code> , so after some researches i understood that i have to escape the <code>\s</code> so i wrote</p>
  
  <pre><code>my @array = split(/[:\\s]/,$lineOfFile);
  </code></pre>
  
  <p>why i have to escape <code>\s</code>, the character <code>:</code> isn't a special character or not?</p>
  
  <p>can someone explain me that? </p>
  
  <p>thanks in advance.</p>