title: Perl Regular Expressions + delete line if it starts with #
body: <p>How to delete lines if they begin with a "#" character using Perl regular expressions?</p>
  
  <p>For example (need to delete the following examples)</p>
  
  <pre><code>line="#a"
  line="     #a"
  line="# a"
  line="    # a"
  </code></pre>
  
  <p>...</p>
  
  <p>the required syntax</p>
  
  <pre><code>   $line =~ s/......../..
  </code></pre>
  
  <p>or skip loop if line begins with "#"</p>
  
  <p>from my code:</p>
  
  <pre><code>open my $IN  ,'&lt;', $file      or die "can't open '$file'  for reading: $!";
  while( defined( $line = &lt;$IN&gt; ) ){
  
  .
  .
  .
  </code></pre>