title: Checkbutton in perl Tk is selecting all options
body: <p>I'm creating a list of checkbuttons in perl tk using a loop. </p>
  
  <pre><code>    $i=1;
      $n=5;
      @x=1;
      while($i &lt;= $n){
      $mw-&gt;Checkbutton(-&gt;text=&gt;$i,-variable=&gt;\$ckval,-&gt;command=&gt;sub{
                   if($ckval){print $i}
      })-&gt;pack;
      $i=$i+@x;
      }
  </code></pre>
  
  <p>The correct value of i is printed on the screen, but all the checkbuttons seem to be selected. How do I avoid this? Thanks in advance.</p>