title: tcl "switch -glob" does not match with variable
body: <p>I encountered this issue on both Solaris and Linux, with tcl version 8.3/8.4</p>
  
  <p>please see the following code:</p>
  
  <pre><code>#!/usr/bin/tclsh
  
  set pattern "this is * and *"
  set str "this is tcl and c++"
  
  switch -glob $str {
  
    $pattern {
      puts "matched pattern"
    }
    "this is * and *" {
      puts "matched plain text"
    }
    default {
      puts "matched none"
    }
  
  }
  </code></pre>
  
  <p>and the result is "matched plain text".
  I though it should have matched the $pattern... is this an incorrect usage of switch, or I am not giving correct pattern for -glob option?</p>
  
  <p>please someone give some idea and it is better if you can tell how to modify the code to make it run with switch and variable.</p>
  
  <p>Thanks!
  XM</p>