title: Why is p modified in numeric lines?
body: <p>Take a look at the following code.  My intention was to set the variable <code>p</code> only in alphabetic lines.</p>
  
  <pre><code>awk '/^[A-Z]/{p="$0"; print "set p: " $p}
  {print "p: " $p}' &lt;&lt;EOF
  A
  1
  2
  3
  B
  4
  5
  6
  EOF
  </code></pre>
  
  <p>The program generates the following output on my system:</p>
  
  <pre><code>set p: A
  p: A
  p: 1
  p: 2
  p: 3
  set p: B
  p: B
  p: 4
  p: 5
  p: 6
  </code></pre>
  
  <p>Although <code>p</code> is set only in alphabetic lines, the values changes in every line. Why?</p>